andygrove opened a new issue, #7765:
URL: https://github.com/apache/datafusion-comet/issues/7765

   A Spark `PartialMerge` over input sorted on some of its grouping keys runs 
as DataFusion's `Final` mode (`HashAggBuilder` in 
`native/core/src/execution/planner/aggregate.rs`, with support in 
`merge_as_partial.rs`). #6880 added this because DataFusion 55 ran `Single` 
there with the legacy `GroupedHashAggregateStream`, whose spill could fail 
against `CometFairMemoryPool`'s fair limit. `Final` runs a 
`ClusteredFinalAggregateStream`, which the fair pool exempts from that limit by 
name (`limited_to_its_share`).
   
   On DataFusion 56, `Single` over partially sorted input runs a 
`ClusteredSingleAggregateStream` (with `enable_migration_aggregate`, which 
defaults to true). That stream spills when refused, and `SpillReplayPool` 
covers its spill replay. So the switch may no longer be needed.
   
   To check: run `Single` there and see whether the #6880 tests in 
`CometAggregateSuite` still pass ("PartialMerge over input sorted on a prefix 
of its keys spills" and "PartialMerge over a sort-merge join on a prefix of its 
keys spills"), along with `partial_merge_over_sorted_input_runs_as_final` in 
`planner.rs`. If they do, remove the switch, the `Final` path in 
`merge_as_partial.rs` if nothing else uses it, and the #6880 part of the 
`limited_to_its_share` docs.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to