Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [null & default] Insert rows report error "undefined data type:Int64: invalid parameter" when insert without the default value field #36485

Closed
1 task done
binbinlv opened this issue Sep 25, 2024 · 3 comments
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Sep 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-20240920-6e430bd4
- Deployment mode(standalone or cluster):both
- MQ type(rocksmq, pulsar or kafka):    all
- SDK version(e.g. pymilvus v2.0.0rc2): 2.5.0rc80
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

Insert rows report error "undefined data type:Int64: invalid parameter" when insert without the default value field

RPC error: [insert_rows], <MilvusException: (code=1100, message=undefined data type:Int64: invalid parameter)>, <Time:{'RPC start': '2024-09-25 11:12:19.687618', 'RPC error': '2024-09-25 11:12:20.037542'}>
Traceback (most recent call last):
  File "./default_rows.py", line 24, in <module>
    collection.insert(data={"id": 4, "vector": [7,8,9]})
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/orm/collection.py", line 507, in insert
    return conn.insert_rows(
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 141, in handler
    raise e from e
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 137, in handler
    return func(*args, **kwargs)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 176, in handler
    return func(self, *args, **kwargs)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 116, in handler
    raise e from e
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/decorators.py", line 86, in handler
    return func(*args, **kwargs)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/client/grpc_handler.py", line 496, in insert_rows
    check_status(resp.status)
  File "/Users/binbin/milvus_latest/lib/python3.8/site-packages/pymilvus/client/utils.py", line 63, in check_status
    raise MilvusException(status.code, status.reason, status.error_code)
pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=undefined data type:Int64: invalid parameter)>

Expected Behavior

Insert rows successfully when insert without the default value field

Steps To Reproduce

from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility
import json
import random


connections.connect()

dim = 3
schema = CollectionSchema(fields=[
    FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, auto_id=False),
    FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3),
    FieldSchema(name="flat", dtype=DataType.INT64, default_value=999),
])

collection = Collection("test_binbin_123", schema=schema)

collection.insert(data={"id": 4, "vector": [7,8,9]})

Milvus Log

No response

Anything else?

No response

@binbinlv binbinlv added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 25, 2024
@binbinlv binbinlv added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 25, 2024
@binbinlv binbinlv added this to the 2.5.0 milestone Sep 25, 2024
@smellthemoon
Copy link
Contributor

related with milvus-io/pymilvus#2275. pr merged, could you please check it? @binbinlv

@smellthemoon
Copy link
Contributor

/assign @binbinlv

@binbinlv
Copy link
Contributor Author

Verified and fixed:

pymilvus:2.5.0rc88
milvus: master-20241011-3fe0f829-amd64

results:

>>> dim = 3
>>> schema = CollectionSchema(fields=[
...     FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, auto_id=False),
...     FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3),
...     FieldSchema(name="flat", dtype=DataType.INT64, default_value=999),
... ])
>>>
>>>
>>> collection = Collection("test_binbin_12", schema=schema)
>>> collection.insert(data={"id": 4, "vector": [7,8,9]})
(insert count: 1, delete count: 0, upsert count: 0, timestamp: 453149575917862918, success count: 1, err count: 0
>>>
>>>
>>> index_param = {"index_type": "IVF_FLAT", "metric_type": "L2", "params": {"nlist": 100}}
>>> collection.create_index("vector", index_param, index_name="index_name_1")
Status(code=0, message=)
>>>
>>> collection.load()
>>> collection.query(expr="id>=0", output_fields=["flat", "vector"])
data: ["{'flat': 999, 'vector': [7.0, 8.0, 9.0], 'id': 4}"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants