alamb commented on code in PR #8979:
URL: https://github.com/apache/arrow-datafusion/pull/8979#discussion_r1465002252


##########
datafusion/physical-expr/src/aggregate/count_distinct.rs:
##########
@@ -109,54 +97,52 @@ impl AggregateExpr for DistinctCount {
         use DataType::*;
         use TimeUnit::*;
 
-        match &self.state_data_type {
-            Int8 => native_distinct_count_accumulator!(Int8Type),
-            Int16 => native_distinct_count_accumulator!(Int16Type),
-            Int32 => native_distinct_count_accumulator!(Int32Type),
-            Int64 => native_distinct_count_accumulator!(Int64Type),
-            UInt8 => native_distinct_count_accumulator!(UInt8Type),
-            UInt16 => native_distinct_count_accumulator!(UInt16Type),
-            UInt32 => native_distinct_count_accumulator!(UInt32Type),
-            UInt64 => native_distinct_count_accumulator!(UInt64Type),
-            Decimal128(_, _) => 
native_distinct_count_accumulator!(Decimal128Type),
-            Decimal256(_, _) => 
native_distinct_count_accumulator!(Decimal256Type),
-
-            Date32 => native_distinct_count_accumulator!(Date32Type),
-            Date64 => native_distinct_count_accumulator!(Date64Type),
+        Ok(Box::new(match &self.state_data_type {
+            Int8 => NativeDistinctCountAccumulator::<Int8Type>::new(),

Review Comment:
   I think all these arms need the `Box` individually as they are actually 
different types.
   
   ```suggestion
               Int8 => 
Box::new(NativeDistinctCountAccumulator::<Int8Type>::new()), 
   ```



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