From aecb46a08bcda827ddc974b1a40372691d93a8b1 Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Mon, 29 Sep 2025 21:15:05 +0800 Subject: [PATCH] fix: Skip empty loop for process growing segment (#44606) issue: #43427 The GISFunction asserts that the segment_offsets cannot be nullptr. When size is 0, the segment_offsets is nullptr, so the loop is skiped. Signed-off-by: Cai Zhang --- internal/core/src/exec/expression/Expr.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/core/src/exec/expression/Expr.h b/internal/core/src/exec/expression/Expr.h index 7d11142db6..6d57823d21 100644 --- a/internal/core/src/exec/expression/Expr.h +++ b/internal/core/src/exec/expression/Expr.h @@ -357,6 +357,8 @@ class SegmentExpr : public Expr { Assert(num_data_chunk_ == 1); auto need_size = std::min(active_count_ - current_data_chunk_pos_, batch_size_); + if (need_size == 0) + return 0; //do not go empty-loop at the bound of the chunk auto& skip_index = segment_->GetSkipIndex(); auto pw = segment_->get_batch_views( @@ -683,6 +685,8 @@ class SegmentExpr : public Expr { : size_per_chunk_ - data_pos; size = std::min(size, batch_size_ - processed_size); + if (size == 0) + continue; //do not go empty-loop at the bound of the chunk auto& skip_index = segment_->GetSkipIndex(); auto pw = segment_->chunk_data(op_ctx_, field_id_, i);