alamb commented on code in PR #21456:
URL: https://github.com/apache/datafusion/pull/21456#discussion_r3057868955


##########
datafusion/functions-aggregate-common/src/aggregate/count_distinct/native.rs:
##########
@@ -165,3 +165,354 @@ impl<T: ArrowPrimitiveType + Debug> Accumulator for 
FloatDistinctCountAccumulato
         size_of_val(self) + self.values.size()
     }
 }
+
+/// Optimized COUNT DISTINCT accumulator for u8 using a bool array.
+/// Uses 256 bytes to track all possible u8 values.
+#[derive(Debug)]
+pub struct BoolArray256DistinctCountAccumulator {
+    seen: Box<[bool; 256]>,

Review Comment:
   I think you can probably use a `BooleanBuffer` from Arrow to make this 
signifcantly faster (I think `[bool` uses a byte for each booelan) 🤔 



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

Reply via email to