fix: fail to get empty index num rows (#39155)

#39125

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
pull/39215/head
smellthemoon 2025-01-13 16:04:58 +08:00 committed by GitHub
parent 5c5948cb70
commit accc9e7fbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 3 deletions

View File

@ -176,9 +176,14 @@ ScalarIndexSort<T>::LoadWithoutAssemble(const BinarySet& index_binary,
auto index_data = index_binary.GetByName("index_data");
data_.resize(index_size);
auto index_num_rows = index_binary.GetByName("index_num_rows");
if (index_num_rows) {
memcpy(&total_num_rows_,
index_num_rows->data.get(),
(size_t)index_num_rows->size);
} else {
total_num_rows_ = index_size;
}
idx_to_offsets_.resize(total_num_rows_);
valid_bitset_ = TargetBitmap(total_num_rows_, false);
memcpy(data_.data(), index_data->data.get(), (size_t)index_data->size);