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


##########
datafusion/physical-expr/src/aggregate/count_distinct/mod.rs:
##########
@@ -130,18 +132,22 @@ impl AggregateExpr for DistinctCount {
             Time64(Nanosecond) => {
                 
Box::new(PrimitiveDistinctCountAccumulator::<Time64NanosecondType>::new())
             }
-            Timestamp(Microsecond, _) => 
Box::new(PrimitiveDistinctCountAccumulator::<
-                TimestampMicrosecondType,
-            >::new()),
-            Timestamp(Millisecond, _) => 
Box::new(PrimitiveDistinctCountAccumulator::<
-                TimestampMillisecondType,
-            >::new()),
-            Timestamp(Nanosecond, _) => 
Box::new(PrimitiveDistinctCountAccumulator::<
-                TimestampNanosecondType,
-            >::new()),
-            Timestamp(Second, _) => {
-                
Box::new(PrimitiveDistinctCountAccumulator::<TimestampSecondType>::new())
-            }
+            dt @ Timestamp(Microsecond, _) => Box::new(

Review Comment:
   I wonder if we should defensively always set `with_data_type` to 
`PrimitiveDistinctCountAccumulator` 🤔 
   
   I tried to come up with other `DataType` that doesn't have a 1:1 mapping to 
its `ArrowPrimitiveType` and I don't think there is one, but always supplying 
the `data_type` might be a more defensive pattern



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