Skip to content

Commit

Permalink
[fix]InListPredicate wrong result (apache#10211)
Browse files Browse the repository at this point in the history
* fix

* reg test

Co-authored-by: Wang Bo <wangbo36@meituan.com>
  • Loading branch information
wangbo and Wang Bo authored Jun 17, 2022
1 parent 6baa694 commit f7789f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/olap/in_list_predicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class InListPredicateBase : public ColumnPredicate {
}
}

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

0 comments on commit f7789f4

Please sign in to comment.