@@ -82,7 +82,18 @@ CREATE EXTERNAL TABLE table5
8282STORED AS ARROW
8383LOCATION 'test_files/scratch/explain_tree/table5.arrow';
8484
85-
85+ statement ok
86+ CREATE UNBOUNDED EXTERNAL TABLE annotated_data_infinite2 (
87+ a0 INTEGER,
88+ a INTEGER,
89+ b INTEGER,
90+ c INTEGER,
91+ d INTEGER
92+ )
93+ STORED AS CSV
94+ WITH ORDER (a ASC, b ASC, c ASC)
95+ LOCATION '../core/tests/data/window_2.csv'
96+ OPTIONS ('format.has_header' 'true');
8697
8798######## Begin Queries ########
8899
@@ -528,6 +539,52 @@ physical_plan
52853917)│ format: arrow │
52954018)└───────────────────────────┘
530541
542+ # Query with PartialSortExec.
543+ query TT
544+ EXPLAIN SELECT *
545+ FROM annotated_data_infinite2
546+ ORDER BY a, b, d;
547+ ----
548+ logical_plan
549+ 01)Sort: annotated_data_infinite2.a ASC NULLS LAST, annotated_data_infinite2.b ASC NULLS LAST, annotated_data_infinite2.d ASC NULLS LAST
550+ 02)--TableScan: annotated_data_infinite2 projection=[a0, a, b, c, d]
551+ physical_plan
552+ 01)┌───────────────────────────┐
553+ 02)│ PartialSortExec │
554+ 03)│ -------------------- │
555+ 04)│ sort keys: │
556+ 05)│ a@1 ASC NULLS LAST, b@2 │
557+ 06)│ ASC NULLS LAST, d@4 │
558+ 07)│ ASC NULLS LAST │
559+ 08)└─────────────┬─────────────┘
560+ 09)┌─────────────┴─────────────┐
561+ 10)│ StreamingTableExec │
562+ 11)└───────────────────────────┘
563+
564+ query TT
565+ EXPLAIN SELECT *
566+ FROM annotated_data_infinite2
567+ ORDER BY a, b, d
568+ LIMIT 50;
569+ ----
570+ logical_plan
571+ 01)Sort: annotated_data_infinite2.a ASC NULLS LAST, annotated_data_infinite2.b ASC NULLS LAST, annotated_data_infinite2.d ASC NULLS LAST, fetch=50
572+ 02)--TableScan: annotated_data_infinite2 projection=[a0, a, b, c, d]
573+ physical_plan
574+ 01)┌───────────────────────────┐
575+ 02)│ PartialSortExec │
576+ 03)│ -------------------- │
577+ 04)│ limit: 50 │
578+ 05)│ │
579+ 06)│ sort keys: │
580+ 07)│ a@1 ASC NULLS LAST, b@2 │
581+ 08)│ ASC NULLS LAST, d@4 │
582+ 09)│ ASC NULLS LAST │
583+ 10)└─────────────┬─────────────┘
584+ 11)┌─────────────┴─────────────┐
585+ 12)│ StreamingTableExec │
586+ 13)└───────────────────────────┘
587+
531588# Query with hash join.
532589query TT
533590explain select * from table1 inner join table2 on table1.int_col = table2.int_col and table1.string_col = table2.string_col;
@@ -616,7 +673,6 @@ physical_plan
61667334)│ format: csv │
61767435)└───────────────────────────┘
618675
619-
620676# cleanup
621677statement ok
622678drop table table1;
0 commit comments