yashaggarwal85d commented on code in PR #26637:
URL: https://github.com/apache/datafusion/pull/26637#discussion_r4366063623
##########
datafusion/physical-plan/src/aggregates/clustered_final_stream.rs:
##########
@@ -340,7 +341,15 @@ impl Aggregating {
Ok(()) => {}
Err(oom @ DataFusionError::ResourcesExhausted(_)) => {
let Some(spill_context) = self.spill_context.as_mut() else
{
- return Err(oom);
+ // Without spilling, emitting completed groups is the
only
Review Comment:
It's intentional, to keep this PR minimal. When a spill context exists, the
same refused reservation decides whether to spill, so checking the reservation
first leaves that path and the success path exactly as they are. It also
matches what `ClusteredPartialAggregateStream` does after #26576. I added a
one-line comment saying this. I agree that "take completed groups first, then
size once" is cleaner, and as you say neither lowers the real peak. I'd rather
change that ordering across all three streams in a separate PR, if you think
it's worth doing.
--
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]