ariel-miculas-trif opened a new issue, #22164:
URL: https://github.com/apache/datafusion/issues/22164

   ### Describe the bug
   
   When the partial hash aggregation with GroupOrdering::None cannot reserve 
more memory, it switches to an early emit phase with EmitTo::First(n), where n 
is close to the length of group_values. `take_n` implementations use 
`first_n_offsets = self.offsets.drain(0..n).collect::<Vec<_>>();`, which copies 
the n elements into a new allocation. Furthermore, drain doesn't affect the 
Vec's capacity, so no memory freeing is done.
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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