Dandandan commented on code in PR #7358:
URL: https://github.com/apache/arrow-datafusion/pull/7358#discussion_r1301839587


##########
datafusion/physical-expr/src/aggregate/sum_distinct.rs:
##########
@@ -106,29 +116,56 @@ impl PartialEq<dyn Any> for DistinctSum {
     }
 }
 
-#[derive(Debug)]
-struct DistinctSumAccumulator {
-    hash_values: HashSet<ScalarValue, RandomState>,
+/// A wrapper around a type to provide hash for floats
+#[derive(Copy, Clone)]
+struct Hashable<T>(T);
+
+impl<T: ToByteSlice> std::hash::Hash for Hashable<T> {
+    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+        self.0.to_byte_slice().hash(state)

Review Comment:
   In other cases I think we only do this for floats and use the 
`state.hash_one(self.0)` in other cases.



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