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]: [int8_vector] The int8_vector is not shown in the results when specifying the int8_vector field as output_fields for query #39847

Closed
1 task done
binbinlv opened this issue Feb 13, 2025 · 6 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 Feb 13, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-20250211-85c9f92f-amd64
- Deployment mode(standalone or cluster):both
- MQ type(rocksmq, pulsar or kafka):    all
- SDK version(e.g. pymilvus v2.0.0rc2): 2.6.0rc71
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

The int8_vector is not shown in the results when specifying the int8_vector field as output_fields for query

>>> client.query(collection_name="customized_setup_1", filter="my_id>=0", output_fields=["my_vector"])
data: ["{'my_id': 0}"]

Expected Behavior

The int8_vector is shown in the results when specifying the int8_vector field as output_fields for query

just like float_vector:

>>> client.query(collection_name="customized_setup_2", filter="my_id>=0", output_fields=["my_vector"])
data: ["{'my_id': 0, 'my_vector': [0.48306835, 0.9815398, 0.13763158, 0.0997467, 0.14570269, 0.83381623, 0.2533495, 0.5141766, 3.248233e-06, 0.7560254, 0.78803337, 0.20656978, 0.5998218, 0.92462415, 0.5946385, 0.6319435, 0.35751677, 0.13305469, 0.35023752, 0.2134315, 0.7266131, 0.45943576, 0.4115885, 0.094741896, 0.42435962, 0.36004803, 0.3514786, 0.5841294, 0.71644586, 0.17080733, 0.014636853, 0.12820345, 0.8857452, 0.63410044, 0.6873833, 0.18846478, 0.22275887, 0.33786368, 0.40385348, 0.48239967, 0.0026390124, 0.90537494, 0.019583173, 0.14822645, 0.120368354, 0.5146042, 0.2832205, 0.78208506, 0.6385497, 0.12974623, 0.86614126, 0.32375425, 0.94300115, 0.29979256, 0.9403251, 0.35166037, 0.38923737, 0.046944916, 0.16529597, 0.66263044, 0.70765626, 0.9447244, 0.9664119, 0.82592314, 0.29692733, 0.55993456, 0.88830036, 0.7149717, 0.13324727, 0.24039853, 0.5394017, 0.3482095, 0.6519117, 0.9961026, 0.09185784, 0.7966022, 0.37718624, 0.37350395, 0.07291514, 0.5765629, 0.9380147, 0.8548175, 0.16825835, 0.047109794, 0.02843495, 0.58276457, 0.8786268, 0.6065395, 0.24458265, 0.3322088, 0.53052264, 0.26629698, 0.30301484, 0.7512133, 0.7805258, 0.47281718, 0.2468269, 0.27081817, 0.6599332, 0.20857278, 0.586381, 0.57643646, 0.75740004, 0.8954807, 0.5434921, 0.18676259, 0.50763893, 0.4595938, 0.90946364, 0.036301173, 0.8530404, 0.80743694, 0.16855665, 0.18533601, 0.8363561, 0.2781933, 0.5601252, 0.62934434, 0.73877335, 0.9165499, 0.96782345, 0.07416456, 0.15385732, 0.4842282, 0.011274599, 0.0977744, 0.345789, 0.38579237]}"]

Steps To Reproduce

from pymilvus import MilvusClient, DataType
import numpy as np
import random


client = MilvusClient()
dim=128
schema = client.create_schema()
schema.add_field(field_name="my_id", datatype=DataType.INT64, is_primary=True)
schema.add_field(field_name="my_vector", datatype=DataType.INT8_VECTOR, dim=128)
schema.add_field(field_name="my_varchar", datatype=DataType.VARCHAR, max_length=512)

index_params = client.prepare_index_params()
index_params.add_index(field_name="my_vector", index_type="AUTOINDEX", metric_type="COSINE")
client.create_collection(collection_name="customized_setup_1", schema=schema, index_params=index_params)

def gen_int8_vectors(num, dim):
     raw_vectors = []
     int8_vectors = []
     for _ in range(num):
        raw_vector = [random.randint(-128, 127) for _ in range(dim)]
        raw_vectors.append(raw_vector)
        int8_vector = np.array(raw_vector, dtype=np.int8)
        int8_vectors.append(int8_vector)
     return raw_vectors, int8_vectors

_, vectors = gen_int8_vectors(1, dim)

data = [{"my_id": 0, "my_vector": vectors[0], "my_varchar": "varchar"}]
client.insert(collection_name="customized_setup_1", data=data)

client.flush(collection_name="customized_setup_1")
client.query(collection_name="customized_setup_1", filter="my_id>=0", output_fields=["my_vector"])

Milvus Log

https://grafana-4am.zilliz.cc/explore?orgId=1&panes=%7B%22Fjq%22:%7B%22datasource%22:%22vhI6Vw67k%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bcluster%3D%5C%22devops%5C%22,namespace%3D%5C%22chaos-testing%5C%22,pod%3D~%5C%22master-latest-lpbqj.%2A%5C%22%7D%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22vhI6Vw67k%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D%7D&schemaVersion=1

Anything else?

collection name: customized_setup_1
timeline: about 2025-02-13 14:38

@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 Feb 13, 2025
@binbinlv binbinlv added this to the 2.6.0 milestone Feb 13, 2025
@binbinlv
Copy link
Contributor Author

/assign @cydrain

@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 Feb 13, 2025
@binbinlv
Copy link
Contributor Author

And the default result for query is different between float_vector and int8_vector too:

float_vector: (vector is included)

>>> client.query(collection_name="customized_setup_2", filter="my_id>=0")
data: ["{'my_id': 0, 'my_vector': [0.48306835, 0.9815398, 0.13763158, 0.0997467, 0.14570269, 0.83381623, 0.2533495, 0.5141766, 3.248233e-06, 0.7560254, 0.78803337, 0.20656978, 0.5998218, 0.92462415, 0.5946385, 0.6319435, 0.35751677, 0.13305469, 0.35023752, 0.2134315, 0.7266131, 0.45943576, 0.4115885, 0.094741896, 0.42435962, 0.36004803, 0.3514786, 0.5841294, 0.71644586, 0.17080733, 0.014636853, 0.12820345, 0.8857452, 0.63410044, 0.6873833, 0.18846478, 0.22275887, 0.33786368, 0.40385348, 0.48239967, 0.0026390124, 0.90537494, 0.019583173, 0.14822645, 0.120368354, 0.5146042, 0.2832205, 0.78208506, 0.6385497, 0.12974623, 0.86614126, 0.32375425, 0.94300115, 0.29979256, 0.9403251, 0.35166037, 0.38923737, 0.046944916, 0.16529597, 0.66263044, 0.70765626, 0.9447244, 0.9664119, 0.82592314, 0.29692733, 0.55993456, 0.88830036, 0.7149717, 0.13324727, 0.24039853, 0.5394017, 0.3482095, 0.6519117, 0.9961026, 0.09185784, 0.7966022, 0.37718624, 0.37350395, 0.07291514, 0.5765629, 0.9380147, 0.8548175, 0.16825835, 0.047109794, 0.02843495, 0.58276457, 0.8786268, 0.6065395, 0.24458265, 0.3322088, 0.53052264, 0.26629698, 0.30301484, 0.7512133, 0.7805258, 0.47281718, 0.2468269, 0.27081817, 0.6599332, 0.20857278, 0.586381, 0.57643646, 0.75740004, 0.8954807, 0.5434921, 0.18676259, 0.50763893, 0.4595938, 0.90946364, 0.036301173, 0.8530404, 0.80743694, 0.16855665, 0.18533601, 0.8363561, 0.2781933, 0.5601252, 0.62934434, 0.73877335, 0.9165499, 0.96782345, 0.07416456, 0.15385732, 0.4842282, 0.011274599, 0.0977744, 0.345789, 0.38579237], 'my_varchar': 'varchar'}"]

int8_vector (vector is not included)

>>> client.query(collection_name="customized_setup_1", filter="my_id>=0")
data: ["{'my_id': 0, 'my_varchar': 'varchar'}"]

@cydrain
Copy link
Contributor

cydrain commented Feb 13, 2025

@binbinlv
can see vector data now

data: ["{'my_vector': [b'c\\xcd\\x07\\x05\\xae\\x91\\xb6\\x9f4Q\\xb1<S\\xd9\\x11\\xed}\\x99\\xcc\\xc3\\xd3\\x12+\\xb5.\\xd2$*\\xb3\\x05\\xea\\xc6\\x91\\x18\\x18F\\x84\\xe8X*(%\\x83azr\\xc8\\x1ai\\xd1{\\x81\\x8c\\xd0\\xa4\\nA#\\t\\x00\\xba\\x05\\xa9H\\xac\\xa3A?\\xa0\\x9a\\x93hX\\x10\\xbbknX\\xbdOZ\\x04\\xa7`\\x8f\\x83\\x12D\\xef\\xc4;\\xee\\xd0\\x80o\\xbd\\x17\\\\\\x91\\xc1\\x08>\\xb84\\x93\\x14dG\\xbb\\x92,\\x85\\xa7\\x13\\xc3.\\x17\\x0c\\xff\\xf0\\xc8\\xe6\\xa3\\xc4q\\xba\\xaf\\xc3'], 'my_id': 0}"]

@binbinlv
Copy link
Contributor Author

Ok, will verify it when the fix pr is merged.

sre-ci-robot pushed a commit to milvus-io/pymilvus that referenced this issue Feb 14, 2025
@cydrain
Copy link
Contributor

cydrain commented Feb 14, 2025

@binbinlv fix merged

@binbinlv
Copy link
Contributor Author

Verified and fixed:

pymilvus: 2.6.0rc72
milvus: master-20250211-85c9f92f-amd64

results:

>>> client.query(collection_name="customized_setup_1", filter="my_id>=0", output_fields=["my_vector"])
data: ['{\'my_vector\': [b\'\\x9dc<\\x84\\xaa2\\x97:\\xfb\\xba\\xac\\xe8\\x87\\xa2\\xee\\n\\xd2^\\x8d\\x07\\xfb\\xe3\\x1d\\x14\\x87\\x97.db\\xfb\\xe7\\x04\\x05\\xed>\\xc9\\xee\\xd3bn\\xa7\\x80/\\xa3\\xf6\\x87Cg\\x04\\xc6\\x07\\xf1\\xec+\\xa9B%|\\xc2\\x9d\\x16\\xbe\\x91\\xa1\\xe89|\\x01l5W\\x9c\\x03\\xea3\\xa5="\\r\\xb0\\x83\\x91\\xdeo\\xe9\\x8e\\xcf\\x8a\\x84 1\\x94\\xaeJ\\xc1\\xcb1x\\xd2\\x19\\x96"~r\\xfe5\\xedbe\\x837J\\xd0\\x04\\x82\\xe4\\xc6d\\xd6\\x98&\\xd8\\xfdG\\xa1\\xd7O\\x95\'], \'my_id\': 0}', '{\'my_vector\': [b\'_I &\\x1b\\xc7^\\x8b\\xb6\\x9d\\x95\\xb6\\xc0\\xeb\\x85\\xc1\\xa7\\xd4O\\xcc|^x@y~\\xc30\\x92q"\\xb6\\x14\\xa8Z\\x00q\\xea\\x8b\\x88"\\x8ec\\xb7gq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5}', '{\'my_vector\': [b\'\\xfe\\x9e\\xacM\\xba\\xdc\\x00o\\xfc6\\xc6\\x98\\xd3\\xc9r>\\xac+#\\xda\\xe0}(B\\xde<\\xb2\\xc57\\xc4\\x84\\xf2)0\\x83\\x10~\\x06\\r\\xec\\x93\\x18j\\xfb\\xca\\x00R\\x87"\\xb3;^\\x06l\\xd5Q\\xe4\\x9f)\\x1d\\xa4Q:V\\x1a\\x18N\\xff\\x8c\\xc8\\xd9\\xa1\\x04\\x929\\x08\\xc2\\x07\\xc8A\\n\\x98\\xb1oKi\\x19\\xf0RK\\xa8$j\\xca?2\\x9c\\xcd\\x11E\\xa3\\xc1A\\x8e\\x8c\\x1f\\xddAat0\\x1e\\x9e\\xd4\\n\\x020\\x01\\x05\\x91\\x9a!=\\t\\xaf\\x985\\xfa\'], \'my_id\': 6}', "{'my_vector': [b'n22\\xc3\\x8eX\\xd9\\x80\\xaaa-\\xcd\\xfc}3\\x18u#Q\\x1c\\xcd\\xc5|}\\xa2a\\xbe\\x8b\\x05\\x98|\\xdc\\t\\xf4y|\\x82!\\x87\\x8e\\xe7\\x80\\xdf\\xb5\\xe3\\x9d\\xe7\\xce\\x87\\xcc#\\xe8\\xb1I\\xac\\xd0\\xdcl\\xac\\x8f\\xa1\\xdfs\\x14\\xc9\\xff\\x1b$\\t\\x82aS\\x08i\\x85d\\x9c\\x9a\\x0e2\\xc85F\\xc7\\x97\\x1eC\\\\\\xdc\\n\\xfa\\xaf\\xf6\\xcb,\\x15\\xf8\\x9ddw\\x90@\\x93o\\xc9\\xdfY=\\x16\\xb8#\\xd0\\xe1%,\\x03\\xff\\xe83\\xe2\\xf1\\x1e\\xf2U\\xabifU'], 'my_id': 7}", '{\'my_vector\': [b"{6{\\xb1X2L\\xf8@o\\xe0\\xa1\\xb8>\\xef;PM\\n\\x1c\\xd6\\x1d[\\xda\\xc5K]\\x84$X\\xf4D\\x0bJL\\xe4\\x9bc\\xf7q\\x1cD\\x147\\x1bg\\xa4T\\x13\\xca\\x08\\x15S\\xe0\\x9f\\x01O\\x8d\\xb61B\\x18Z\\xdc\\x88\\xd3d\\x8d\\xc9\\xb6\\xeb:\\x04\\xd1\\xfe\\xa7\\xff\\xb5\\x97~\'\\x90\\xa9\\xd2\\xb6\\x9b\\x9d\\xa0I}\\x9a\\xb6\\x93q\\x89\\xc3\\xd3\\xd0\\xc1\\xac\\xff\\xf3\\x92\\xe0G\\xcb\\xd4d%\\x87\\x14\\xe8\\x0cI\\x9agO\\x97\\xdf\\x94/\\x02u\\xaf\\xb3p@!"], \'my_id\': 8}', '{\'my_vector\': [b\'w\\x07n\\\\"\\xfcY\\xf2jQ{E\\x0b\\\\\\xaey@\\x1d\\xba\\xc7\\\\d\\x82q\\x96\\x97\\xe5Y\\xdd\\xc3\\xda\\xdb\\xf5\\x07SS{N\\x1b\\xdb\\x8a?\\x01\\x86\\xa0g\\x9e\\xd6\\xf1\\x9c#h\\x83\\xcb\\xc1\\n\\xea\\x9aas\\x13\\\\\\xe3)A\\x16?\\xde*\\x07\\x17X\\xa4S,\\xeb8]\\xa0\\xbf\\r\\x83\\xecE1W[k\\xff\\x96\\x1f;\\xfe\\xe8\\xae\\x1b\\x8b\\xa4`\\xf4f-\\xb1\\x192\\x9d\\x89Y5\\xa4\\xd6\\xb7\\xaa$\\x8f\\r\\xb5\\xfc\\x12T\\x047\\xcf\\xff\\xd6\\x9f\\xc9+\'], \'my_id\': 9}'] ...
>>>
>>>
>>> client.query(collection_name="customized_setup_1", filter="my_id>=0", limit=1)
data: ['{\'my_vector\': [b\'\\x9dc<\\x84\\xaa2\\x97:\\xfb\\xba\\xac\\xe8\\x87\\xa2\\xee\\n\\xd2^\\x8d\\x07\\xfb\\xe3\\x1d\\x14\\x87\\x97.db\\xfb\\xe7\\x04\\x05\\xed>\\xc9\\xee\\xd3bn\\xa7\\x80/\\xa3\\xf6\\x87Cg\\x04\\xc6\\x07\\xf1\\xec+\\xa9B%|\\xc2\\x9d\\x16\\xbe\\x91\\xa1\\xe89|\\x01l5W\\x9c\\x03\\xea3\\xa5="\\r\\xb0\\x83\\x91\\xdeo\\xe9\\x8e\\xcf\\x8a\\x84 1\\x94\\xaeJ\\xc1\\xcb1x\\xd2\\x19\\x96"~r\\xfe5\\xedbe\\x837J\\xd0\\x04\\x82\\xe4\\xc6d\\xd6\\x98&\\xd8\\xfdG\\xa1\\xd7O\\x95\'], \'my_varchar\': \'varchar\', \'my_id\': 0}']

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