code: def build_result(
      res: ttypes.SelectResponse,
  ) -> tuple[dict[str | Any, list[Any, Any]], dict[str | Any, Any]]:
      data_dict = {}
      data_type_dict = {}
      column_counter = defaultdict(int)
      for column_def, column_field in zip(
          res.column_defs, res.column_fields
      ):
          original_column_name = column_def.name
          column_counter[original_column_name] += 1
          column_name = (
              f"{original_column_name}_{column_counter[original_column_name]}"
              if column_counter[original_column_name] > 1
              else original_column_name
          )
  
          column_type = column_field.column_type
          column_data_type = column_def.data_type
          column_vectors = column_field.column_vectors
  
          data_list = column_vector_to_list(
              column_type, column_data_type, column_vectors
          )
          # data_series = pd.Series(data_list, dtype=logic_type_to_dtype(column_data_type))
          data_dict[column_name] = data_list
          data_type_dict[column_name] = column_data_type
  
      return data_dict, data_type_dict
  
file_path: infinity/python/infinity/remote_thrift/types.py
imports: import struct
  from collections import defaultdict
  from typing import Any, Tuple, Dict, List
  import polars
  from numpy import dtype
  import infinity.remote_thrift.infinity_thrift_rpc.ttypes
label_desc: Use image node_id 7 for calling a global function with example usage: build_result(res) and returns: data_dict,  data_type_dict