Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.6
-
None
-
debian9
-
2020-2, 2020-3, 2020-4, 2020-5, 2020-6, 2020-7
Description
IN() clause does not evaluate properly on some columns with a window function
in the example below, the column r is computed with the function DENSE_RANK in a subselect, and there is a where r in (...). The where clause does not filter rows as expected.
Note that rows are properly filtered if the where clause is rewritten as (r=1 or r=2)
create table t(a int, b int) engine=ColumnStore;
insert into t(a,b) values(1,4),(2,3),(3,2),(4,1);
select
a,
r
from (
select
a,
DENSE_RANK() OVER `w_0` as `r`
from t
WINDOW `w_0` as ( ORDER BY `b` DESC)
) t0
where r in (1,2)
=> returns
1,1
2,2
3,3
4,4
instead of just the first 2 rows