Print more information when loading fields with different lines (#17448)

Signed-off-by: xige-16 <xi.ge@zilliz.com>
pull/17458/head
xige-16 2022-06-08 20:16:06 +08:00 committed by GitHub
parent 2a5151f047
commit 6d078ebe7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 6 deletions

View File

@ -95,9 +95,10 @@ SegmentSealedImpl::LoadVecIndex(const LoadIndexInfo& info) {
AssertInfo(!get_bit(index_ready_bitset_, field_id),
"vector index has been exist at " + std::to_string(field_id.get()));
if (row_count_opt_.has_value()) {
AssertInfo(row_count_opt_.value() == row_count, "load data has different row count from other columns");
} else {
row_count_opt_ = row_count;
AssertInfo(row_count_opt_.value() == row_count,
"field (" + std::to_string(field_id.get()) + ") data has different row count (" +
std::to_string(row_count) + ") than other column's row count (" +
std::to_string(row_count_opt_.value()) + ")");
}
AssertInfo(!vector_indexings_.is_ready(field_id), "vec index is not ready");
vector_indexings_.append_field_indexing(field_id, GetMetricType(metric_type_str), index);
@ -124,9 +125,10 @@ SegmentSealedImpl::LoadScalarIndex(const LoadIndexInfo& info) {
AssertInfo(!get_bit(index_ready_bitset_, field_id),
"scalar index has been exist at " + std::to_string(field_id.get()));
if (row_count_opt_.has_value()) {
AssertInfo(row_count_opt_.value() == row_count, "load data has different row count from other columns");
} else {
row_count_opt_ = row_count;
AssertInfo(row_count_opt_.value() == row_count,
"field (" + std::to_string(field_id.get()) + ") data has different row count (" +
std::to_string(row_count) + ") than other column's row count (" +
std::to_string(row_count_opt_.value()) + ")");
}
scalar_indexings_[field_id] = index;
@ -168,6 +170,12 @@ SegmentSealedImpl::LoadFieldData(const LoadFieldDataInfo& info) {
auto field_id = FieldId(info.field_id);
AssertInfo(info.field_data != nullptr, "Field info blob is null");
auto size = info.row_count;
if (row_count_opt_.has_value()) {
AssertInfo(row_count_opt_.value() == size, "field (" + std::to_string(field_id.get()) +
") data has different row count (" + std::to_string(size) +
") than other column's row count (" +
std::to_string(row_count_opt_.value()) + ")");
}
if (SystemProperty::Instance().IsSystem(field_id)) {
auto system_field_type = SystemProperty::Instance().GetSystemFieldType(field_id);