alamb commented on code in PR #8849:
URL: https://github.com/apache/arrow-datafusion/pull/8849#discussion_r1460463891
##########
datafusion/physical-expr/src/aggregate/count_distinct.rs:
##########
@@ -438,11 +446,292 @@ where
}
}
+#[derive(Debug)]
+struct StringDistinctCountAccumulator(Mutex<SSOStringHashSet>);
+impl StringDistinctCountAccumulator {
+ fn new() -> Self {
+ Self(Mutex::new(SSOStringHashSet::new()))
+ }
+}
+
+impl Accumulator for StringDistinctCountAccumulator {
+ fn state(&self) -> Result<Vec<ScalarValue>> {
+ // TODO this should not need a lock/clone (should make
+ // `Accumulator::state` take a mutable reference)
Review Comment:
In order to avoid the copy the accumulator needs to be &mut here, but it is
not. This is worth its own ticket I think
--
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]