[fix]InListPredicate wrong result (#10211)

* fix

* reg test

Co-authored-by: Wang Bo <wangbo36@meituan.com>
This commit is contained in:
wangbo
2022-06-17 18:34:25 +08:00
committed by GitHub
parent 6baa694bc1
commit f7789f4bc4
2 changed files with 17 additions and 1 deletions

View File

@ -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;

View File

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