comphead commented on code in PR #9498:
URL: https://github.com/apache/arrow-datafusion/pull/9498#discussion_r1518230332
##########
datafusion/sqllogictest/test_files/window.slt:
##########
@@ -4133,18 +4133,35 @@ x x x x x x
x x x NULL NULL NULL
b b b b b b
-# LAG window function IGNORE/RESPECT NULLS support with ascending order and
nondefault offset
-query TTTT
+# LAG window function IGNORE/RESPECT NULLS support with descending order and
default offset 1 trigger evaluate_all
+query TTTTTTI
+select lag(a) ignore nulls over (order by id desc) as x,
+ lag(a, 1, null) ignore nulls over (order by id desc) as x1,
+ lag(a, 1, 'def') ignore nulls over (order by id desc) as x2,
+ lag(a) respect nulls over (order by id desc) as x3,
+ lag(a, 1, null) respect nulls over (order by id desc) as x4,
+ lag(a, 1, 'def') respect nulls over (order by id desc) as x5,
+ sum(id) over (order by id desc ROWS BETWEEN UNBOUNDED PRECEDING AND
UNBOUNDED FOLLOWING) as sum_id
+from (select 2 id, 'b' a union all select 1 id, null a union all select 3 id,
null union all select 4 id, 'x')
+----
+NULL NULL def NULL NULL def 10
+x x x x x x 10
+x x x NULL NULL NULL 10
+b b b b b b 10
+
+# LAG window function IGNORE/RESPECT NULLS support with ascending order and
nondefault offset trigger evaluate_all
+query TTTTI
select lag(a, 2, null) ignore nulls over (order by id) as x1,
lag(a, 2, 'def') ignore nulls over (order by id) as x2,
lag(a, 2, null) respect nulls over (order by id) as x4,
- lag(a, 2, 'def') respect nulls over (order by id) as x5
+ lag(a, 2, 'def') respect nulls over (order by id) as x5,
+ sum(id) over (order by id desc ROWS BETWEEN UNBOUNDED PRECEDING AND
UNBOUNDED FOLLOWING) as sum_id
from (select 2 id, 'b' a union all select 1 id, null a union all select 3 id,
null union all select 4 id, 'x')
----
Review Comment:
double checked tests result in Spark, evetything is correct 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]