enhance: Refine error message when search vector type not matched (#31725)

Previously the error message only reports the case happened without
field name and vector type.

This PR add field name and vector type information in the error
messages.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2024-04-01 10:11:12 +08:00 committed by GitHub
parent b0a941c2fb
commit 3ffe126dc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,11 @@ ParsePlaceholderGroup(const Plan* plan,
auto& field_meta = plan->schema_[field_id];
AssertInfo(static_cast<int>(field_meta.get_data_type()) ==
static_cast<int>(info.type()),
"vector type must be the same");
"vector type must be the same, field {} - type {}, search "
"info type {}",
field_meta.get_name().get(),
field_meta.get_data_type(),
static_cast<DataType>(info.type()));
element.num_of_queries_ = info.values_size();
AssertInfo(element.num_of_queries_ > 0, "must have queries");
if (info.type() ==