Dandandan commented on code in PR #15324:
URL: https://github.com/apache/datafusion/pull/15324#discussion_r2005787338


##########
datafusion/functions-aggregate/src/count.rs:
##########
@@ -752,10 +761,245 @@ impl Accumulator for DistinctCountAccumulator {
     }
 }
 
+/// GroupsAccumulator for COUNT DISTINCT operations
+#[derive(Debug)]
+pub struct DistinctCountGroupsAccumulator {
+    /// One HashSet per group to track distinct values
+    distinct_sets: Vec<HashSet<ScalarValue, RandomState>>,

Review Comment:
   I wonder if a single `HashSet<(u64, ScalarValue), RandomState>>` (i.e. also 
index by group id rather than create a new `HashSet` per group) might be 
faster? It will use less memory and intuitively should be more cache friendly.



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

Reply via email to