alamb commented on code in PR #27299:
URL: https://github.com/apache/datafusion/pull/27299#discussion_r4784667245
##########
datafusion/functions-aggregate-common/src/aggregate/count_distinct/groups.rs:
##########
@@ -63,23 +105,41 @@ where
debug_assert_eq!(values.len(), 1);
self.counts.resize(total_num_groups, 0);
let arr = values[0].as_primitive::<T>();
- accumulate(group_indices, arr, opt_filter, |group_idx, value| {
- if self.seen.insert((group_idx, value)) {
- self.counts[group_idx] += 1;
- }
- });
+ if let Some(first_values) = &mut self.first_values {
+ first_values.resize(total_num_groups, T::Native::default());
Review Comment:
i am not sure worriying about a few MB is worth extra complexity at this
point
--
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]