stuartcarnie opened a new issue, #6674: URL: https://github.com/apache/arrow-datafusion/issues/6674
### Describe the bug Excessive memory usage of `MedianAccumulator` due to incorrect use of the `Vec<T>::reserve` API: https://github.com/apache/arrow-datafusion/blob/c4928b035db3c3dc20554b5abe23e4de2a322fe4/datafusion/physical-expr/src/aggregate/median.rs#L129 which is documented as: ```rust alloc::vec impl<T, A: Allocator> Vec<T, A> pub fn reserve(&mut self, additional: usize) ``` > Reserves capacity for at least `additional` more elements to be inserted in the given `Vec<T>`. The collection may reserve more space to speculatively avoid frequent reallocations. After calling `reserve`, capacity will be greater than or equal to `self.len() + additional` ### 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]
