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

panxiaolei 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 f7789f4bc4 [fix]InListPredicate wrong result (#10211)
f7789f4bc4 is described below

commit f7789f4bc4ebf5d76949ebc2025f24fc5bc9cc40
Author: wangbo <wan...@apache.org>
AuthorDate: Fri Jun 17 18:34:25 2022 +0800

    [fix]InListPredicate wrong result (#10211)
    
    * fix
    
    * reg test
    
    Co-authored-by: Wang Bo <wangb...@meituan.com>
---
 be/src/olap/in_list_predicate.h                          |  2 +-
 .../duplicate/storage/test_dup_tab_basic_int.groovy      | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/be/src/olap/in_list_predicate.h b/be/src/olap/in_list_predicate.h
index f41a7f51c5..de47a655c3 100644
--- a/be/src/olap/in_list_predicate.h
+++ b/be/src/olap/in_list_predicate.h
@@ -338,7 +338,7 @@ private:
                     }
                 }
 
-                if constexpr (is_opposite != (PT == PredicateType::IN_LIST)) {
+                if constexpr (!is_opposite) {
                     if (_operator(_values.find(reinterpret_cast<const 
T&>(data_array[idx])),
                                   _values.end())) {
                         sel[new_size++] = idx;
diff --git 
a/regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_int.groovy
 
b/regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_int.groovy
index ac8ea799bb..94430e575c 100644
--- 
a/regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_int.groovy
+++ 
b/regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_int.groovy
@@ -152,5 +152,21 @@ PROPERTIES (
         result([[1,2,3,4]])
     }
 
+    // predicate in with two values
+    test {
+        sql """
+            select distinct userid as col from ${table1} where userid in (3,7) 
order by col;
+        """
+        result([[3],[7]])
+    }
+
+    // predicate not with two values
+    test {
+        sql """
+            select distinct userid as col from ${table1} where userid not in 
(3,7) order by col;
+        """
+        result([[11],[15],[19],[22]])
+    }
+
     sql "drop table if exists ${table1}"
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to