ariel-miculas commented on code in PR #22416:
URL: https://github.com/apache/datafusion/pull/22416#discussion_r3281561152


##########
datafusion/functions-aggregate/src/min_max.rs:
##########
@@ -55,6 +55,23 @@ use half::f16;
 use std::mem::size_of_val;
 use std::ops::Deref;
 
+/// Splits `vec` at `n`, returning the first `n` elements and leaving the
+/// remainder in `vec`. Allocates for whichever portion is smaller to minimize
+/// peak memory: `drain+collect` when `n <= remaining`, `split_off+replace`
+/// when `remaining < n`.
+///
+/// Mirrors `split_vec_min_alloc` in `datafusion-physical-plan`'s
+/// `aggregates::group_values::multi_group_by` module (added in #22165); kept
+/// local here because that helper is `pub(super)` to a different crate.
+fn split_vec_min_alloc<T>(vec: &mut Vec<T>, n: usize) -> Vec<T> {

Review Comment:
   I have another use case for it in 
datafusion/expr-common/src/groups_accumulator.rs so it would be nice to have it 
in one place



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