insert data error #41987
Unanswered
xxxrain
asked this question in
Q&A and General discussion
insert data error
#41987
Replies: 1 comment
-
I create a collection with the same schema, and inset some rows, seems it works well.
The output:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
0 Milvus version 2.5.11
1 create table python script
schema = client.create_schema(enable_dynamic_field=True, description="")
schema.add_field(field_name="kg_id", datatype=DataType.VARCHAR, description="The Primary Key", max_length=256, is_primary=True, auto_id=False)
schema.add_field(field_name="embedding", datatype=DataType.FLOAT_VECTOR, dim=768)
schema.add_field(field_name="node_id", datatype=DataType.VARCHAR, max_length=256)
schema.add_field(field_name="data_id", datatype=DataType.VARCHAR, max_length=256)
schema.add_field(field_name="name", datatype=DataType.VARCHAR, max_length=256)
schema.add_field(field_name="ytenant_id", datatype=DataType.VARCHAR, max_length=256)
schema.add_field(field_name="filter_p_key", datatype=DataType.VARCHAR, max_length=256)
schema.add_field(field_name="table_type", datatype=DataType.VARCHAR, max_length=256)
schema.add_field(field_name="describe", datatype=DataType.VARCHAR, max_length=768, nullable=True, default_value='')
schema.add_field(field_name="created", datatype=DataType.INT64)
schema.add_field(field_name="updated", datatype=DataType.INT64)
index_params = client.prepare_index_params()
index_params.add_index(field_name="embedding", metric_type="COSINE", index_type="AUTOINDEX")
client.create_collection(collection_name="filter_value", schema=schema, index_params=index_params)
2 table state desc
{'collection_name': 'filter_value', 'auto_id': False, 'num_shards': 1, 'description': '', 'fields': [{'field_id': 100, 'name': 'kg_id', 'description': 'The Primary Key', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 256}, 'is_primary': True}, {'field_id': 101, 'name': 'embedding', 'description': '', 'type': <DataType.FLOAT_VECTOR: 101>, 'params': {'dim': 768}}, {'field_id': 102, 'name': 'node_id', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 256}}, {'field_id': 103, 'name': 'data_id', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 256}}, {'field_id': 104, 'name': 'name', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 256}}, {'field_id': 105, 'name': 'ytenant_id', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 256}}, {'field_id': 106, 'name': 'filter_p_key', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 256}}, {'field_id': 107, 'name': 'table_type', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 256}}, {'field_id': 108, 'name': 'describe', 'description': '', 'type': <DataType.VARCHAR: 21>, 'params': {'max_length': 768}, 'default_value': string_data: ""
, 'nullable': True}, {'field_id': 109, 'name': 'created', 'description': '', 'type': <DataType.INT64: 5>, 'params': {}}, {'field_id': 110, 'name': 'updated', 'description': '', 'type': <DataType.INT64: 5>, 'params': {}}], 'functions': [], 'aliases': [], 'collection_id': 458179491513393440, 'consistency_level': 2, 'properties': {}, 'num_partitions': 1, 'enable_dynamic_field': True, 'created_timestamp': 458180054501556226}
3 error
<DataNotMatchException: (code=1, message=Insert missed an field
describe
to collection without set nullable==true or set default_value)>Beta Was this translation helpful? Give feedback.
All reactions