Skip to content

Commit

Permalink
fix: check sparse float before calling get_dim (#37145)
Browse files Browse the repository at this point in the history
#37146

Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby authored Oct 26, 2024
1 parent fd72151 commit a2f0092
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit a2f0092

Please sign in to comment.