korowa commented on code in PR #8721:
URL: https://github.com/apache/arrow-datafusion/pull/8721#discussion_r1440835372


##########
datafusion/physical-expr/src/aggregate/count_distinct.rs:
##########
@@ -192,20 +285,175 @@ impl Accumulator for DistinctCountAccumulator {
     }
 }
 
+struct DistinctCountGroupsAccumulator<T>
+where
+    T: ArrowPrimitiveType + Send,
+{
+    /// Vector for storing unique values sets for each group index
+    unique_values: Vec<HashSet<Hashable<T::Native>>>,

Review Comment:
   That was my initial intention -- but collecting intermediate states is quite 
painful when using pure `HashSet<(group, value)>`, and using additional 
structures for storing chains of values for each group seemed like a memory 
overhead in this case.
   
   However, I agree that managing single hash table per accumulator makes sense 
-- maybe the proper way of speeding up accumulator will be switching to native 
types in regular (current) accumulator first, and then start digging into 
proper groups accumulator implementation which will provide noticeable boost 
:thinking:.



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

Reply via email to