From a2f0092e39d70efcef57b5e1e0dddd032cf7bcc7 Mon Sep 17 00:00:00 2001 From: Bingyi Sun Date: Sat, 26 Oct 2024 16:25:29 +0800 Subject: [PATCH] fix: check sparse float before calling get_dim (#37145) https://github.com/milvus-io/milvus/issues/37146 Signed-off-by: sunby --- .../src/segcore/ChunkedSegmentSealedImpl.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp b/internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp index 532447248d511..a77579c1dbcc7 100644 --- a/internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp +++ b/internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp @@ -453,7 +453,9 @@ ChunkedSegmentSealedImpl::LoadFieldData(FieldId field_id, FieldDataInfo& data) { while (data.arrow_reader_channel->pop(r)) { auto chunk = create_chunk(field_meta, - IsVectorDataType(field_meta.get_data_type()) + IsVectorDataType(field_meta.get_data_type()) && + !IsSparseFloatVectorDataType( + field_meta.get_data_type()) ? field_meta.get_dim() : 1, r->reader); @@ -549,13 +551,15 @@ ChunkedSegmentSealedImpl::MapFieldData(const FieldId field_id, // indices, // element_indices, // valid_data); - auto chunk = create_chunk(field_meta, - IsVectorDataType(field_meta.get_data_type()) - ? field_meta.get_dim() - : 1, - file, - file_offset, - r->reader); + auto chunk = create_chunk( + field_meta, + IsVectorDataType(field_meta.get_data_type()) && + !IsSparseFloatVectorDataType(field_meta.get_data_type()) + ? field_meta.get_dim() + : 1, + file, + file_offset, + r->reader); file_offset += chunk->Size(); chunks.push_back(chunk); }