ariel-miculas commented on PR #22899:
URL: https://github.com/apache/datafusion/pull/22899#issuecomment-4681492191

   Unrelated to this PR, but I have a remark in hash_table.rs:
   ```
       pub(super) fn memory_size(&self) -> usize {
           match &self.state {
               AggregateHashTableState::Building(state) => {
                   let acc = state
                       .accumulators
                       .iter()
                       .map(|acc| acc.accumulator.size())
                       .sum::<usize>();
   
                   acc + state.group_values.size()
                       + state.batch_group_indices.allocated_size()
               }
               AggregateHashTableState::Outputting { output_batch, .. } => {
                   output_batch_memory_size(output_batch)
               }
               AggregateHashTableState::Done => 0,
           }
       }
   ```
   Previously, in the outputting state there was no reservation for the (large) 
output batch, and now there is via output_batch_memory_size(output_batch).
   Since this is a large batch (created via Emit::All for instance), my worry 
is that downstream consumers won't have enough reservation left to reserve the 
same amount of memory (because they see the same size even if just a tiny slice 
of this RecordBatch is consumed).


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