Closed somu-imply closed 2 months ago
some testcases which should start working if this is fixed:
type: "operatorValidation"
sql: |
SELECT
m1,
FLOOR(m1/3),
-- incorrect range frames https://github.com/apache/druid/issues/15739
1 >= COUNT(1) OVER (ORDER BY m1 ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING),
1 >= COUNT(1) OVER (ORDER BY m1 ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING),
1 >= COUNT(1) OVER (ORDER BY m1 RANGE BETWEEN 1 PRECEDING AND 1 PRECEDING),
1 >= COUNT(1) OVER (ORDER BY m1 RANGE BETWEEN 1 FOLLOWING AND 1 FOLLOWING),
-- not sure if this should be allowed or not; but if its allowed it should be 0
0 = COUNT(1) OVER (ORDER BY FLOOR(m1/3) ROWS BETWEEN 2 FOLLOWING AND 1 FOLLOWING),
FROM foo
expectedResults:
- [1.0,0.0,true,true,true,true,true]
- [2.0,0.0,true,true,true,true,true]
- [3.0,1.0,true,true,true,true,true]
- [4.0,1.0,true,true,true,true,true]
- [5.0,1.0,true,true,true,true,true]
- [6.0,2.0,true,true,true,true,true]
At this moment on Druid master, a query like
AND
are planned identically with the native query showing the same offset in the processor for both
Going forward we need to demarcate these cases and make sure we support negative offsets in such a case. At the moment even in native you cannot specify
which throws an IndexOutOfBounds exception.
Steps to reproduce
The csv used in the above query is: us_ecom_orders_com101.csv
Another easy way to reproduce using the druid foo table is