Skip to content

Commit

Permalink
Minor: Add sql level test for lead/lag on arrays (#10345)
Browse files Browse the repository at this point in the history
* Minor: Add sql level test for lead/lag on arrays

* remove redundant test
  • Loading branch information
alamb committed May 2, 2024
1 parent 97148bd commit 3b245ff
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions datafusion/sqllogictest/test_files/window.slt
Original file line number Diff line number Diff line change
Expand Up @@ -4799,3 +4799,26 @@ NULL 4
NULL 3
NULL 2
NULL 1


### Test for window functions with arrays
statement ok
create table array_data
as values
('a',make_array(1, 2, 3)),
('b', make_array(4, 5, 6)),
('c', make_array(7, 8, 9));

query T??
SELECT
column1,
lag(column2) OVER (order by column1),
lead(column2) OVER (order by column1)
FROM array_data;
----
a NULL [4, 5, 6]
b [1, 2, 3] [7, 8, 9]
c [4, 5, 6] NULL

statement ok
drop table array_data

0 comments on commit 3b245ff

Please sign in to comment.