diff --git a/datafusion/sqllogictest/test_files/window.slt b/datafusion/sqllogictest/test_files/window.slt index ec48e73f446f..92b3e3931ec5 100644 --- a/datafusion/sqllogictest/test_files/window.slt +++ b/datafusion/sqllogictest/test_files/window.slt @@ -4799,3 +4799,33 @@ 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, column2 FROM array_data ORDER BY column1; +---- +a [1, 2, 3] +b [4, 5, 6] +c [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