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