@@ -4521,6 +4521,34 @@ false
4521
4521
true
4522
4522
NULL
4523
4523
4524
+ #
4525
+ # Add valid distinct case as aggregation plan test
4526
+ #
4527
+
4528
+ query TT
4529
+ EXPLAIN SELECT DISTINCT c3, min(c1) FROM aggregate_test_100 group by c3 limit 5;
4530
+ ----
4531
+ logical_plan
4532
+ 01)Limit: skip=0, fetch=5
4533
+ 02)--Aggregate: groupBy=[[aggregate_test_100.c3, MIN(aggregate_test_100.c1)]], aggr=[[]]
4534
+ 03)----Aggregate: groupBy=[[aggregate_test_100.c3]], aggr=[[MIN(aggregate_test_100.c1)]]
4535
+ 04)------TableScan: aggregate_test_100 projection=[c1, c3]
4536
+ physical_plan
4537
+ 01)GlobalLimitExec: skip=0, fetch=5
4538
+ 02)--CoalescePartitionsExec
4539
+ 03)----LocalLimitExec: fetch=5
4540
+ 04)------AggregateExec: mode=FinalPartitioned, gby=[c3@0 as c3, MIN(aggregate_test_100.c1)@1 as MIN(aggregate_test_100.c1)], aggr=[], lim=[5]
4541
+ 05)--------CoalesceBatchesExec: target_batch_size=8192
4542
+ 06)----------RepartitionExec: partitioning=Hash([c3@0, MIN(aggregate_test_100.c1)@1], 4), input_partitions=4
4543
+ 07)------------AggregateExec: mode=Partial, gby=[c3@0 as c3, MIN(aggregate_test_100.c1)@1 as MIN(aggregate_test_100.c1)], aggr=[], lim=[5]
4544
+ 08)--------------AggregateExec: mode=FinalPartitioned, gby=[c3@0 as c3], aggr=[MIN(aggregate_test_100.c1)]
4545
+ 09)----------------CoalesceBatchesExec: target_batch_size=8192
4546
+ 10)------------------RepartitionExec: partitioning=Hash([c3@0], 4), input_partitions=4
4547
+ 11)--------------------AggregateExec: mode=Partial, gby=[c3@1 as c3], aggr=[MIN(aggregate_test_100.c1)]
4548
+ 12)----------------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1
4549
+ 13)------------------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c3], has_header=true
4550
+
4551
+
4524
4552
#
4525
4553
# Push limit into distinct group-by aggregation tests
4526
4554
#
0 commit comments