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]: [Nightly] Search on not loaded fields will not report error #39378

Open
1 task done
NicoYuan1986 opened this issue Jan 17, 2025 · 0 comments
Open
1 task done
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

@NicoYuan1986
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: 34c7b08
- Deployment mode(standalone or cluster):standalone
- MQ type(rocksmq, pulsar or kafka):    rocksmq
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

Search on not loaded fields will not report error.

2025-01-16T21:50:34Z {container="step-test"} @pytest.mark.tags(CaseLabel.L1)
2025-01-16T21:50:34Z {container="step-test"} def test_search_on_not_loaded_fields(self):
2025-01-16T21:50:34Z {container="step-test"} """
2025-01-16T21:50:34Z {container="step-test"} target: test search on skipped fields
2025-01-16T21:50:34Z {container="step-test"} method:
2025-01-16T21:50:34Z {container="step-test"} 1. create a collection with fields
2025-01-16T21:50:34Z {container="step-test"} 2. load a part of the fields
2025-01-16T21:50:34Z {container="step-test"} 3. search on skipped fields in expr and/or output_fields
2025-01-16T21:50:34Z {container="step-test"} expected:
2025-01-16T21:50:34Z {container="step-test"} 1.  raise exception
2025-01-16T21:50:34Z {container="step-test"} """
2025-01-16T21:50:34Z {container="step-test"} self._connect()
2025-01-16T21:50:34Z {container="step-test"} name = cf.gen_unique_str()
2025-01-16T21:50:34Z {container="step-test"} dim = 32
2025-01-16T21:50:34Z {container="step-test"} nb = 2000
2025-01-16T21:50:34Z {container="step-test"} pk_field = cf.gen_int64_field(name='pk', is_primary=True)
2025-01-16T21:50:34Z {container="step-test"} not_load_int64_field = cf.gen_int64_field(name="not_int64_load")
2025-01-16T21:50:34Z {container="step-test"} load_string_field = cf.gen_string_field(name="string_load")
2025-01-16T21:50:34Z {container="step-test"} vector_field = cf.gen_float_vec_field(dim=dim)
2025-01-16T21:50:34Z {container="step-test"} schema = cf.gen_collection_schema(fields=[pk_field, not_load_int64_field, load_string_field, vector_field],
2025-01-16T21:50:34Z {container="step-test"} auto_id=True, enable_dynamic_field=True)
2025-01-16T21:50:34Z {container="step-test"} collection_w = self.init_collection_wrap(name=name, schema=schema)
2025-01-16T21:50:34Z {container="step-test"} int_values = [i for i in range(nb)]
2025-01-16T21:50:34Z {container="step-test"} string_values = [str(i) for i in range(nb)]
2025-01-16T21:50:34Z {container="step-test"} float_vec_values = cf.gen_vectors(nb, dim)
2025-01-16T21:50:34Z {container="step-test"} collection_w.insert([int_values, string_values, float_vec_values])
2025-01-16T21:50:34Z {container="step-test"} 
2025-01-16T21:50:34Z {container="step-test"} # build index
2025-01-16T21:50:34Z {container="step-test"} collection_w.create_index(field_name=vector_field.name, index_params=ct.default_index)
2025-01-16T21:50:34Z {container="step-test"} collection_w.load(load_fields=[pk_field.name, vector_field.name, load_string_field.name])
2025-01-16T21:50:34Z {container="step-test"} # search
2025-01-16T21:50:34Z {container="step-test"} search_params = ct.default_search_params
2025-01-16T21:50:34Z {container="step-test"} nq = 1
2025-01-16T21:50:34Z {container="step-test"} search_vectors = float_vec_values[0:nq]
2025-01-16T21:50:34Z {container="step-test"} error = {ct.err_code: 999, ct.err_msg: f"field {not_load_int64_field.name} is not loaded"}
2025-01-16T21:50:34Z {container="step-test"} >       collection_w.search(data=search_vectors, anns_field=vector_field.name, param=search_params,
2025-01-16T21:50:34Z {container="step-test"} limit=10, output_fields=[not_load_int64_field.name, load_string_field.name],
2025-01-16T21:50:34Z {container="step-test"} check_task=CheckTasks.err_res, check_items=error)

2025-01-16T21:50:34Z {container="step-test"} [2025-01-16 20:17:07 - DEBUG - ci_test]: (api_request)  : [Collection.load] args: [None, 1, 180], kwargs: {'load_fields': ['pk', 'float_vector', 'string_load']} (api_request.py:52)
2025-01-16T21:50:34Z {container="step-test"} [2025-01-16 20:17:08 - DEBUG - ci_test]: (api_response) : None  (api_request.py:27)
2025-01-16T21:50:34Z {container="step-test"} [2025-01-16 20:17:08 - DEBUG - ci_test]: (api_request)  : [Collection.search] args: [[[0.18338050756303048, 0.04576889245916608, 0.19126487712031107, 0.19333133709328673, 0.10945140323785169, 0.1580280868912703, 0.05605535716098099, 0.00410007910733039, 0.019330796977636632, 0.006954154238841966, 0.16972730739187775, 0.2110913988521699, 0.021940374435387124, 0.06216311600338715, 0......., kwargs: {} (api_request.py:52)
2025-01-16T21:50:34Z {container="step-test"} [2025-01-16 20:17:08 - DEBUG - ci_test]: (api_response) : data: ['["id: 455359241188068010, distance: 1.0, entity: {\'not_int64_load\': 0, \'string_load\': \'0\'}", "id: 455359241188069993, distance: 0.8925653100013733, entity: {\'not_int64_load\': 1983, \'string_load\': \'1983\'}", "id: 455359241188068474, distance: 0.87794029712677, entity: {\'not_int64_......  (api_request.py:27)

Expected Behavior

report error

Steps To Reproduce

Milvus Log

  1. link: https://jenkins.milvus.io:18080/blue/organizations/jenkins/Milvus%20Nightly%20CI(new)/detail/2.4/146/pipeline/133/
  2. 2025-01-16T20:17:09Z {container="step-test"} [gw4] [ 26%] FAILED testcases/test_field_partial_load.py::TestFieldPartialLoadInvalid::test_search_on_not_loaded_fields

Anything else?

No response

@NicoYuan1986 NicoYuan1986 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 Jan 17, 2025
@NicoYuan1986 NicoYuan1986 added this to the 2.4.21 milestone Jan 17, 2025
@NicoYuan1986 NicoYuan1986 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 Jan 17, 2025
@yanliang567 yanliang567 modified the milestones: 2.4.21, 2.4.22 Jan 24, 2025
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