mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 20:39:36 +08:00
enhance: Opt vector dimension mismatch error message (#29928)
issue: https://github.com/milvus-io/milvus/issues/29791 /kind improvement Signed-off-by: xige-16 <xi.ge@zilliz.com> --------- Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
parent
0d356b0545
commit
aee19dcd6b
@ -59,6 +59,7 @@ enum ErrorCode {
|
||||
ExprInvalid = 2028,
|
||||
UnistdError = 2030,
|
||||
MetricTypeNotMatch = 2031,
|
||||
DimNotMatch = 2032,
|
||||
KnowhereError = 2100,
|
||||
|
||||
};
|
||||
|
@ -49,8 +49,14 @@ ParsePlaceholderGroup(const Plan* plan,
|
||||
AssertInfo(element.num_of_queries_, "must have queries");
|
||||
Assert(element.num_of_queries_ > 0);
|
||||
element.line_sizeof_ = info.values().Get(0).size();
|
||||
AssertInfo(field_meta.get_sizeof() == element.line_sizeof_,
|
||||
"vector dimension mismatch");
|
||||
if (field_meta.get_sizeof() != element.line_sizeof_) {
|
||||
throw SegcoreError(
|
||||
DimNotMatch,
|
||||
fmt::format("vector dimension mismatch, expected vector "
|
||||
"size(byte) {}, actual {}.",
|
||||
field_meta.get_sizeof(),
|
||||
element.line_sizeof_));
|
||||
}
|
||||
auto& target = element.blob_;
|
||||
target.reserve(element.line_sizeof_ * element.num_of_queries_);
|
||||
for (auto& line : info.values()) {
|
||||
|
Loading…
Reference in New Issue
Block a user