2010YOUY01 commented on code in PR #11943: URL: https://github.com/apache/datafusion/pull/11943#discussion_r1721702643
########## datafusion/physical-plan/src/aggregates/row_hash.rs: ########## @@ -62,6 +63,7 @@ pub(crate) enum ExecutionState { /// When producing output, the remaining rows to output are stored /// here and are sliced off as needed in batch_size chunks ProducingOutput(RecordBatch), + ProducingBlocks(Option<usize>), Review Comment: It would be great to add a comment to explain how other states are transitioning to/from `ProducingBlcoks` A sketchy one with simple examples would be enough, and we can polish it later ########## datafusion/physical-plan/src/aggregates/row_hash.rs: ########## @@ -903,9 +992,14 @@ impl GroupedHashAggregateStream { && matches!(self.mode, AggregateMode::Partial) && self.update_memory_reservation().is_err() { - let n = self.group_values.len() / self.batch_size * self.batch_size; - let batch = self.emit(EmitTo::First(n), false)?; - self.exec_state = ExecutionState::ProducingOutput(batch); + if !self.enable_blocked_group_states { Review Comment: Here is an example of spilling logic mixes with this PR's implementation (see review summary) 🤔 -- 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