@@ -82,7 +82,18 @@ CREATE EXTERNAL TABLE table5
82
82
STORED AS ARROW
83
83
LOCATION 'test_files/scratch/explain_tree/table5.arrow';
84
84
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');
86
97
87
98
######## Begin Queries ########
88
99
@@ -528,6 +539,52 @@ physical_plan
528
539
17)│ format: arrow │
529
540
18)└───────────────────────────┘
530
541
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
+
531
588
# Query with hash join.
532
589
query TT
533
590
explain 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
616
673
34)│ format: csv │
617
674
35)└───────────────────────────┘
618
675
619
-
620
676
# cleanup
621
677
statement ok
622
678
drop table table1;
0 commit comments