Skip to content

Commit 2f34cf2

Browse files
committed
add .slt test case
1 parent aa31984 commit 2f34cf2

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎datafusion/sqllogictest/test_files/subquery_sort.slt‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,25 @@ EXPLAIN SELECT c1 FROM (SELECT c1 FROM sink_table ORDER BY c2)
5151
logical_plan TableScan: sink_table projection=[c1]
5252
physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], file_type=csv, has_header=true
5353

54+
statement ok
55+
SET datafusion.sql_parser.enable_subquery_sort_elimination = false;
56+
57+
query TT
58+
EXPLAIN SELECT c1 FROM (SELECT c1 FROM sink_table ORDER BY c2) AS ttt
59+
----
60+
logical_plan
61+
01)SubqueryAlias: ttt
62+
02)--Projection: sink_table.c1
63+
03)----Sort: sink_table.c2 ASC NULLS LAST
64+
04)------TableScan: sink_table projection=[c1, c2]
65+
physical_plan
66+
01)ProjectionExec: expr=[c1@0 as c1]
67+
02)--SortExec: expr=[c2@1 ASC NULLS LAST], preserve_partitioning=[false]
68+
03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2], file_type=csv, has_header=true
69+
70+
statement ok
71+
RESET datafusion.sql_parser.enable_subquery_sort_elimination;
72+
5473

5574
# Do not remove ordering when it's with limit
5675

0 commit comments

Comments
 (0)