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


##########
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:
   It seems like BooleanBuffer is immutable. I didnt have luck using [u8:8] 
while trying to optimize `approx_distinct` : 
   https://github.com/apache/datafusion/pull/21453#issuecomment-4204666466 and 
resorted the approach which yielded good speed up (~2x) vs regression 
using`[u8;8]` 



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