fix: Compute the correct batch size for the geometry index of the growing segment (#45253)

issue: #44648

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2025-11-04 20:25:37 +08:00 committed by GitHub
parent 792e931fcb
commit fa3d4ebfbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1177,10 +1177,6 @@ class SegmentExpr : public Expr {
return ProcessChunksForValidByOffsets<std::string>( return ProcessChunksForValidByOffsets<std::string>(
use_index, input); use_index, input);
} }
case DataType::GEOMETRY: {
return ProcessChunksForValidByOffsets<std::string>(
use_index, input);
}
default: default:
ThrowInfo(DataTypeInvalid, ThrowInfo(DataTypeInvalid,
"unsupported element type: {}", "unsupported element type: {}",
@ -1297,7 +1293,11 @@ class SegmentExpr : public Expr {
auto size = std::min( auto size = std::min(
std::min(size_per_chunk_ - data_pos, batch_size_ - processed_rows), std::min(size_per_chunk_ - data_pos, batch_size_ - processed_rows),
int64_t(chunk_valid_res.size())); int64_t(chunk_valid_res.size()));
if (field_type_ == DataType::GEOMETRY &&
segment_->type() == SegmentType::Growing) {
size = std::min(batch_size_ - processed_rows,
int64_t(chunk_valid_res.size()) - data_pos);
}
valid_result.append(chunk_valid_res, data_pos, size); valid_result.append(chunk_valid_res, data_pos, size);
return size; return size;
} }