alamb commented on code in PR #24785:
URL: https://github.com/apache/datafusion/pull/24785#discussion_r3894289405


##########
datafusion/physical-plan/src/aggregates/partial_reduce_stream.rs:
##########
@@ -68,13 +68,25 @@ use crate::{InputOrderMode, RecordBatchStream, 
SendableRecordBatchStream};
 /// This stage is useful for tree-reduce plans. It consumes the same schema as
 /// a final aggregate stage, but emits the same schema as a partial aggregate
 /// stage.
+///
+/// # Memory Management
+///
+/// If the memory reservation cannot grow after aggregating an input batch, all
+/// accumulated partial states are emitted immediately, and the remaining input
+/// is aggregated with an empty table. This repeats until the input ends.
+///
+/// See [`crate::aggregates::AggregateMode::PartialReduce`] for why it's 
allowed

Review Comment:
   
https://github.com/apache/datafusion/blob/5e168c9d014433f9d34d42ae3c6defa770023942/datafusion/physical-plan/src/aggregates/mod.rs#L339-L372
 for anyone else reading this who wants a quick reference



-- 
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