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(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}" }