This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new daa1b6fd096 branch-4.0: [fix](rf)Fix ColumnPredicate rf may not reset 
judge #58466 (#58558)
daa1b6fd096 is described below

commit daa1b6fd096c9bc3a6134d589c465d2e041e7db4
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 2 09:46:13 2025 +0800

    branch-4.0: [fix](rf)Fix ColumnPredicate rf may not reset judge #58466 
(#58558)
    
    Cherry-picked from #58466
    
    Co-authored-by: Mryange <[email protected]>
---
 be/src/olap/column_predicate.h                     | 10 ++++++++--
 be/src/olap/comparison_predicate.h                 |  1 +
 be/src/olap/rowset/segment_v2/segment_iterator.cpp |  2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/be/src/olap/column_predicate.h b/be/src/olap/column_predicate.h
index 372d71e7a81..6923ff435e3 100644
--- a/be/src/olap/column_predicate.h
+++ b/be/src/olap/column_predicate.h
@@ -25,6 +25,7 @@
 #include "olap/rowset/segment_v2/bloom_filter.h"
 #include "olap/rowset/segment_v2/inverted_index_iterator.h"
 #include "runtime/define_primitive_type.h"
+#include "util/defer_op.h"
 #include "util/runtime_profile.h"
 #include "vec/columns/column.h"
 #include "vec/exprs/vruntimefilter_wrapper.h"
@@ -185,6 +186,8 @@ public:
     // evaluate predicate on IColumn
     // a short circuit eval way
     uint16_t evaluate(const vectorized::IColumn& column, uint16_t* sel, 
uint16_t size) const {
+        Defer defer([&] { try_reset_judge_selectivity(); });
+
         if (always_true()) {
             return size;
         }
@@ -330,10 +333,13 @@ protected:
         _judge_filter_rows = 0;
     }
 
-    void do_judge_selectivity(uint64_t filter_rows, uint64_t input_rows) const 
{
-        if ((_judge_counter--) == 0) {
+    void try_reset_judge_selectivity() const {
+        if (_can_ignore() && ((_judge_counter--) == 0)) {
             reset_judge_selectivity();
         }
+    }
+
+    void do_judge_selectivity(uint64_t filter_rows, uint64_t input_rows) const 
{
         if (!_always_true) {
             _judge_filter_rows += filter_rows;
             _judge_input_rows += input_rows;
diff --git a/be/src/olap/comparison_predicate.h 
b/be/src/olap/comparison_predicate.h
index 98e9590ac3f..7df41bf11fe 100644
--- a/be/src/olap/comparison_predicate.h
+++ b/be/src/olap/comparison_predicate.h
@@ -286,6 +286,7 @@ public:
         Defer defer([&]() {
             update_filter_info(current_evaluated_rows - current_passed_rows,
                                current_evaluated_rows);
+            try_reset_judge_selectivity();
         });
 
         if (column.is_nullable()) {
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp 
b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index 9b2eed85348..69e632b856c 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -2196,7 +2196,7 @@ uint16_t 
SegmentIterator::_evaluate_vectorization_predicate(uint16_t* sel_rowid_
     }
     if (all_pred_always_true) {
         for (const auto& pred : _pre_eval_block_predicate) {
-            pred->always_true();
+            DCHECK(pred->always_true());
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to