From 415a14f636d69533974aff5cd64333256c68857d Mon Sep 17 00:00:00 2001 From: Yongqiang YANG Date: Fri, 29 Dec 2023 15:01:13 +0800 Subject: [PATCH] fix --- be/src/olap/rowset/beta_rowset_reader.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/be/src/olap/rowset/beta_rowset_reader.h b/be/src/olap/rowset/beta_rowset_reader.h index 142e7daa55042be..fd275988164706f 100644 --- a/be/src/olap/rowset/beta_rowset_reader.h +++ b/be/src/olap/rowset/beta_rowset_reader.h @@ -90,7 +90,16 @@ class BetaRowsetReader : public RowsetReader { bool _should_push_down_value_predicates() const; bool _is_merge_iterator() const { return _read_context->need_ordered_result && - _rowset->rowset_meta()->is_segments_overlapping() && _segment_offsets.size() > 1; + _rowset->rowset_meta()->is_segments_overlapping() && _get_segment_num() > 1; + } + + int32_t _get_segment_num() const { + auto [seg_start, seg_end] = _segment_offsets; + if (seg_start == seg_end) { + seg_start = 0; + seg_end = _rowset->num_segments(); + } + return seg_end - seg_start; } DorisCallOnce _init_iter_once;