Skip to content

Commit 2b9bece

Browse files
committed
Add negative test case for ordered_array.parquet
1 parent 2a99dda commit 2b9bece

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

datafusion/sqllogictest/test_files/unnest.slt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,23 @@ physical_plan
10241024
03)----ProjectionExec: expr=[column1@0 as __unnest_placeholder(t.column1), column2@1 as column2]
10251025
04)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/unnest/ordered_array.parquet]]}, projection=[column1, column2], output_ordering=[column2@1 ASC NULLS LAST], file_type=parquet
10261026

1027+
# Explain should have a SortExec at the top because we order by the output of the unnest (i.e. discarding the ordering)
1028+
query TT
1029+
EXPLAIN SELECT UNNEST(column1) as unnested, column2 FROM t ORDER BY 1;
1030+
----
1031+
logical_plan
1032+
01)Sort: unnested ASC NULLS LAST
1033+
02)--Projection: __unnest_placeholder(t.column1,depth=1) AS UNNEST(t.column1) AS unnested, t.column2
1034+
03)----Unnest: lists[__unnest_placeholder(t.column1)|depth=1] structs[]
1035+
04)------Projection: t.column1 AS __unnest_placeholder(t.column1), t.column2
1036+
05)--------TableScan: t projection=[column1, column2]
1037+
physical_plan
1038+
01)SortExec: expr=[unnested@0 ASC NULLS LAST], preserve_partitioning=[false]
1039+
02)--ProjectionExec: expr=[__unnest_placeholder(t.column1,depth=1)@0 as unnested, column2@1 as column2]
1040+
03)----UnnestExec
1041+
04)------ProjectionExec: expr=[column1@0 as __unnest_placeholder(t.column1), column2@1 as column2]
1042+
05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/unnest/ordered_array.parquet]]}, projection=[column1, column2], output_ordering=[column2@1 ASC NULLS LAST], file_type=parquet
1043+
10271044
# cleanup
10281045
statement ok
10291046
drop table t;

0 commit comments

Comments
 (0)