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

zhangstar333 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f6768c7c51 [opt](in list) remove redundant condition in camp_field 
(#60912)
6f6768c7c51 is described below

commit 6f6768c7c51702795dc530d684374c1c9bcf4967
Author: zhangstar333 <[email protected]>
AuthorDate: Tue Mar 3 14:29:53 2026 +0800

    [opt](in list) remove redundant condition in camp_field (#60912)
    
    ### What problem does this PR solve?
    
    Problem Summary:
    
    in camp_field function, this or condition is same, (A && B) or (B and A)
---
 be/src/olap/in_list_predicate.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/be/src/olap/in_list_predicate.h b/be/src/olap/in_list_predicate.h
index b27e75844db..a7e0e44c8dc 100644
--- a/be/src/olap/in_list_predicate.h
+++ b/be/src/olap/in_list_predicate.h
@@ -20,6 +20,7 @@
 #include <cstdint>
 #include <roaring/roaring.hh>
 
+#include "common/compiler_util.h"
 #include "common/exception.h"
 #include "decimal12.h"
 #include "exprs/hybrid_set.h"
@@ -259,10 +260,8 @@ public:
 
     bool camp_field(const vectorized::Field& min_field, const 
vectorized::Field& max_field) const {
         if constexpr (PT == PredicateType::IN_LIST) {
-            return (Compare::less_equal(min_field.template get<Type>(), 
_max_value) &&
-                    Compare::greater_equal(max_field.template get<Type>(), 
_min_value)) ||
-                   (Compare::greater_equal(max_field.template get<Type>(), 
_min_value) &&
-                    Compare::less_equal(min_field.template get<Type>(), 
_max_value));
+            return Compare::less_equal(min_field.template get<Type>(), 
_max_value) &&
+                   Compare::greater_equal(max_field.template get<Type>(), 
_min_value);
         } else {
             return true;
         }
@@ -271,18 +270,19 @@ public:
     bool evaluate_and(vectorized::ParquetPredicate::ColumnStat* statistic) 
const override {
         bool result = true;
         if ((*statistic->get_stat_func)(statistic, column_id())) {
-            vectorized::Field min_field;
-            vectorized::Field max_field;
             if (statistic->is_all_null) {
                 result = false;
-            } else if (!vectorized::ParquetPredicate::parse_min_max_value(
-                                statistic->col_schema, 
statistic->encoded_min_value,
-                                statistic->encoded_max_value, *statistic->ctz, 
&min_field,
-                                &max_field)
-                                .ok()) [[unlikely]] {
-                result = true;
             } else {
-                result = camp_field(min_field, max_field);
+                vectorized::Field min_field;
+                vectorized::Field max_field;
+                auto st = vectorized::ParquetPredicate::parse_min_max_value(
+                        statistic->col_schema, statistic->encoded_min_value,
+                        statistic->encoded_max_value, *statistic->ctz, 
&min_field, &max_field);
+                if (LIKELY(st.ok())) {
+                    result = camp_field(min_field, max_field);
+                } else { // status is not ok, return true directly
+                    result = true;
+                }
             }
         }
 


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

Reply via email to