class_docstr: This handler handles connection and execution of the Milvus statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Milvus","statements","."]
code: def select(
      self,
      table_name: str,
      columns: List[str] = None,
      conditions: List[FilterCondition] = None,
      offset: int = None,
      limit: int = None,
  ) -> HandlerResponse:
      # Load collection table
      collection = Collection(table_name)
      try:
          collection.load()
      except Exception as e:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Error loading collection {table_name}: {e}",
          )
  
      # Find vector filter in conditions
      vector_filter = (
          []
          if conditions is None
          else [
              condition.value
              for condition in conditions
              if condition.column == TableField.SEARCH_VECTOR.value
          ]
      )
  
      # Generate search arguments
      search_arguments = {"param": {}}
      # TODO: check if distance in columns work
      if columns:
          search_arguments["output_fields"] = columns
      else:
          search_arguments["output_fields"] = [
              schema_obj.name for schema_obj in self.SCHEMA
          ]
      search_arguments["expr"] = self._translate_conditions(conditions)
      # NOTE: According to api sum of offset and limit should be less than 16384.
      api_limit = 16384
      if (
          limit is not None
          and offset is not None
          and limit + offset >= api_limit
      ):
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Sum of limit and offset should be less than {api_limit}",
          )
      if limit is not None:
          search_arguments["limit"] = limit
      else:
          search_arguments["limit"] = self._search_limit
      if offset is not None:
          search_arguments["param"]["offset"] = offset
  
      # Vector search
      if vector_filter:
          search_arguments["data"] = vector_filter
          search_arguments["anns_field"] = TableField.EMBEDDINGS.value
          search_arguments["param"][
              "metric_type"
          ] = self._search_params["search_metric_type"]
          search_arguments["param"][
              "ignore_growing"
          ] = self._search_params["search_ignore_growing"]
          search_arguments["param"]["param"] = self._search_params[
              "search_ignore_growing"
          ]
          results = collection.search(**search_arguments)
          columns_required = [
              TableField.ID.value,
              TableField.DISTANCE.value,
          ]
          if TableField.CONTENT.value in columns:
              columns_required.append(TableField.CONTENT.value)
          if TableField.EMBEDDINGS.value in columns:
              columns_required.append(TableField.EMBEDDINGS.value)
          data = {k: [] for k in columns_required}
          for hits in results:
              for hit in hits:
                  for col in columns_required:
                      if col != TableField.DISTANCE.value:
                          data[col].append(hit.entity.get(col))
                      else:
                          data[TableField.DISTANCE.value].append(
                              hit.distance
                          )
          return Response(
              resp_type=RESPONSE_TYPE.TABLE,
              data_frame=pd.DataFrame(data),
          )
      else:
          # Basic search
          if not search_arguments["expr"]:
              search_arguments["expr"] = ""
          search_arguments["output_fields"] = (
              [
                  TableField.ID.value,
                  TableField.CONTENT.value,
                  TableField.EMBEDDINGS.value,
              ]
              if not columns
              else columns
          )
          results = collection.query(**search_arguments)
          return Response(
              resp_type=RESPONSE_TYPE.TABLE,
              data_frame=pd.DataFrame.from_records(results),
          )
  
imports: from collections import OrderedDict
  from typing import List, Optional
  import pandas
  from pymilvus import Collection, CollectionSchema, DataType, FieldSchema, connections, utility
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.response import RESPONSE_TYPE
  from mindsdb.integrations.libs.response import HandlerResponse
  from mindsdb.integrations.libs.response import HandlerResponse
  from mindsdb.integrations.libs.response import HandlerStatusResponse
  from mindsdb.integrations.libs.vectordatabase_handler import FilterCondition, FilterOperator, TableField, VectorStoreHandler
  from mindsdb.utilities import log
label_desc: Use image node_id 10 for calling the MilvusHandler obj's underlying member method code with example usage: obj.select(table_name, columns, conditions, offset, limit) and returns: Response, Response, Response, Response