killme2008 commented on code in PR #17618:
URL: https://github.com/apache/datafusion/pull/17618#discussion_r2366954838


##########
datafusion/functions-aggregate/src/approx_distinct.rs:
##########
@@ -347,11 +363,26 @@ impl AggregateUDFImpl for ApproxDistinct {
             DataType::Int16 => 
Box::new(NumericHLLAccumulator::<Int16Type>::new()),
             DataType::Int32 => 
Box::new(NumericHLLAccumulator::<Int32Type>::new()),
             DataType::Int64 => 
Box::new(NumericHLLAccumulator::<Int64Type>::new()),
+            DataType::Date32 => 
Box::new(NumericHLLAccumulator::<Date32Type>::new()),
+            DataType::Date64 => 
Box::new(NumericHLLAccumulator::<Date64Type>::new()),
+            DataType::Timestamp(TimeUnit::Second, _) => {
+                Box::new(NumericHLLAccumulator::<TimestampSecondType>::new())
+            }
+            DataType::Timestamp(TimeUnit::Millisecond, _) => {
+                
Box::new(NumericHLLAccumulator::<TimestampMillisecondType>::new())
+            }
+            DataType::Timestamp(TimeUnit::Microsecond, _) => {
+                
Box::new(NumericHLLAccumulator::<TimestampMicrosecondType>::new())
+            }
+            DataType::Timestamp(TimeUnit::Nanosecond, _) => {
+                
Box::new(NumericHLLAccumulator::<TimestampNanosecondType>::new())
+            }
             DataType::Utf8 => Box::new(StringHLLAccumulator::<i32>::new()),
             DataType::LargeUtf8 => 
Box::new(StringHLLAccumulator::<i64>::new()),
             DataType::Utf8View => 
Box::new(StringViewHLLAccumulator::<i32>::new()),
             DataType::Binary => Box::new(BinaryHLLAccumulator::<i32>::new()),
             DataType::LargeBinary => 
Box::new(BinaryHLLAccumulator::<i64>::new()),
+            DataType::Null => Box::new(NullHLLAccumulator::default()),

Review Comment:
   The test only covers supported types, so removing the catch-all won't help. 
However, I agree that time should be supported.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to