Dandandan commented on code in PR #13581: URL: https://github.com/apache/datafusion/pull/13581#discussion_r1861872899
########## datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/accumulate.rs: ########## @@ -371,6 +371,87 @@ pub fn accumulate<T, F>( } } +/// Accumulates with multiple accumulate(value) columns. (e.g. `corr(c1, c2)`) +/// +/// This method assumes that for any input record index, if any of the value column +/// is null, or it's filtered out by `opt_filter`, then the record would be ignored. +/// (won't be accumulated by `value_fn`) +pub fn accumulate_multiple<T, F>( + group_indices: &[usize], + value_columns: &[&PrimitiveArray<T>], + opt_filter: Option<&BooleanArray>, + mut value_fn: F, +) where + T: ArrowPrimitiveType + Send, + F: FnMut(usize, &[T::Native]) + Send, +{ + let acc_cols: Vec<&[T::Native]> = value_columns Review Comment: I don't think collecting into `Vec` might not be necessary? -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org