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","."]
docstr: Create a collection with default parameters in the Milvus database as described in documentation.
docstr_tok: ["Create","a","collection","with","default","parameters","in","the","Milvus","database","as","described","in","documentation","."]
code: def create_table(
      self, table_name: str, if_not_exists=True
  ) -> HandlerResponse:
      """Create a collection with default parameters in the Milvus database as described in documentation."""
      id = FieldSchema(
          name=TableField.ID.value,
          dtype=DataType.VARCHAR,
          is_primary=True,
          max_length=self._create_table_params["create_id_max_len"],
          auto_id=self._create_table_params["create_auto_id"],
      )
      embeddings = FieldSchema(
          name=TableField.EMBEDDINGS.value,
          dtype=DataType.FLOAT_VECTOR,
          dim=self._create_table_params["create_embedding_dim"],
      )
      content = FieldSchema(
          name=TableField.CONTENT.value,
          dtype=DataType.VARCHAR,
          max_length=self._create_table_params[
              "create_content_max_len"
          ],
          default_value=self._create_table_params[
              "create_content_default_value"
          ],
      )
      schema = CollectionSchema(
          fields=[id, content, embeddings],
          description=self._create_table_params[
              "create_schema_description"
          ],
          enable_dynamic_field=self._create_table_params[
              "create_dynamic_field"
          ],
      )
      collection_name = table_name
      collection = None
      try:
          collection = Collection(
              name=collection_name,
              schema=schema,
              using=self._create_table_params["create_alias"],
          )
      except Exception as e:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Unable to create collection `{table_name}`: {e}",
          )
      try:
          collection.create_index(
              field_name=TableField.EMBEDDINGS.value,
              index_params={
                  "index_type": self._create_table_params[
                      "create_index_type"
                  ],
                  "metric_type": self._create_table_params[
                      "create_index_metric_type"
                  ],
                  "params": self._create_table_params[
                      "create_index_params"
                  ],
              },
          )
      except Exception as e:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Unable to create index on collection `{table_name}`: {e}",
          )
      return Response(resp_type=RESPONSE_TYPE.OK)
  
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 11 for calling the MilvusHandler obj's underlying member method code with example usage: obj.create_table(table_name, if_not_exists) and returns: Response, Response, Response