joroKr21 commented on code in PR #11592: URL: https://github.com/apache/datafusion/pull/11592#discussion_r1686483705
########## datafusion/physical-expr-common/src/aggregate/groups_accumulator/accumulate.rs: ########## @@ -324,6 +324,18 @@ impl NullState { } } + /// Check if the accumulated value for the group at the given `index` is valid, + /// meaning that there was at least one value passing the filter for this group. + pub fn is_valid(&self, index: usize) -> bool { + self.seen_values.get_bit(index) + } Review Comment: This is the signature of `accumulate`: ```rust pub fn accumulate<T, F>( &mut self, group_indices: &[usize], values: &PrimitiveArray<T>, opt_filter: Option<&BooleanArray>, total_num_groups: usize, mut value_fn: F, ) where T: ArrowPrimitiveType + Send, F: FnMut(usize, bool, T::Native) + Send ``` But I can't use `is_null` inside `value_fn` because the `NullState` is already borrowed as mutable -- 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