test: add query expr test for larger int (#29599)

issue: https://github.com/milvus-io/milvus/issues/29570 
add query expr test for larger int

Signed-off-by: elstic <hao.wang@zilliz.com>
This commit is contained in:
elstic 2024-01-02 14:22:47 +08:00 committed by GitHub
parent 5f00bad4b8
commit 0db6b26842
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -340,6 +340,28 @@ class TestQueryParams(TestcaseBase):
for _r in res:
assert _r[ct.default_bool_field_name] == bool_value
@pytest.mark.tags(CaseLabel.L2)
def test_query_expr_by_int64(self):
"""
target: test query through int64 field and output int64 field
method: use int64 as query expr parameter
expected: verify query output number
"""
self._connect()
df = cf.gen_default_dataframe_data(nb=ct.default_nb*10)
self.collection_wrap.construct_from_dataframe(cf.gen_unique_str(prefix), df,
primary_field=ct.default_int64_field_name)
assert self.collection_wrap.num_entities == ct.default_nb * 10
self.collection_wrap.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
self.collection_wrap.load()
# filter on int64 fields
expr_list = [f'{ct.default_int64_field_name} > 8192 && {ct.default_int64_field_name} < 8194',
f'{ct.default_int64_field_name} > 16384 && {ct.default_int64_field_name} < 16386']
for expr in expr_list:
res, _ = self.collection_wrap.query(expr, output_fields=[ct.default_int64_field_name])
assert len(res) == 1
@pytest.mark.tags(CaseLabel.L1)
def test_query_expr_by_int8_field(self):
"""