fix: fix auto merge error (#34661)

#33704

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
This commit is contained in:
zhagnlu 2024-07-13 13:07:37 +08:00 committed by GitHub
parent 2c462d387b
commit 18c83c6466
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 14 deletions

View File

@ -477,14 +477,6 @@ class SparseFloatColumn : public ColumnBase {
return static_cast<const char*>(static_cast<const void*>(vec_.data()));
}
// This is used to advice mmap prefetch, we don't currently support mmap for
// sparse float vector thus not implemented for now.
size_t
ByteSize() const override {
PanicInfo(ErrorCode::Unsupported,
"ByteSize not supported for sparse float column");
}
size_t
Capacity() const override {
PanicInfo(ErrorCode::Unsupported,

View File

@ -48,7 +48,7 @@ namespace milvus {
constexpr size_t FILE_STRING_PADDING = 1;
constexpr size_t FILE_ARRAY_PADDING = 1;
inline size_t
inline size_t
PaddingSize(const DataType& type) {
switch (type) {
case DataType::JSON:
@ -148,11 +148,18 @@ WriteFieldData(File& file,
break;
}
case DataType::VECTOR_SPARSE_FLOAT: {
// TODO(SPARSE): this is for mmap to write data to disk so that
// the file can be mmaped into memory.
PanicInfo(
ErrorCode::NotImplemented,
"WriteFieldData for VECTOR_SPARSE_FLOAT not implemented");
for (size_t i = 0; i < data->get_num_rows(); ++i) {
auto vec =
static_cast<const knowhere::sparse::SparseRow<float>*>(
data->RawValue(i));
ssize_t written =
file.Write(vec->data(), vec->data_byte_size());
if (written < vec->data_byte_size()) {
break;
}
total_written += written;
}
break;
}
default:
PanicInfo(DataTypeInvalid,