UBarney commented on issue #15818: URL: https://github.com/apache/datafusion/issues/15818#issuecomment-2822958433
There's no `SortExec` in the query plan. Maybe it was removed by the optimizer? > ``` query TT explain select sum(a) from (select a from t order by a) group by a; ---- logical_plan 01)Projection: sum(t.a) 02)--Aggregate: groupBy=[[t.a]], aggr=[[sum(CAST(t.a AS Int64))]] 03)----TableScan: t projection=[a] physical_plan 01)ProjectionExec: expr=[sum(t.a)@1 as sum(t.a)] 02)--AggregateExec: mode=FinalPartitioned, gby=[a@0 as a], aggr=[sum(t.a)] 03)----CoalesceBatchesExec: target_batch_size=8192 04)------RepartitionExec: partitioning=Hash([a@0], 4), input_partitions=4 05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 06)----------AggregateExec: mode=Partial, gby=[a@0 as a], aggr=[sum(t.a)] 07)------------DataSourceExec: partitions=1, partition_sizes=[1] ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org