bharadwaj-pendyala commented on code in PR #25876:
URL: https://github.com/apache/datafusion/pull/25876#discussion_r4325543938


##########
datafusion/ffi/tests/ffi_udaf.rs:
##########
@@ -82,6 +82,27 @@ mod tests {
         Ok(())
     }
 
+    #[test]
+    fn test_distinct_handling() -> Result<()> {
+        let module = get_module()?;
+
+        let ffi_stddev_func = (module.create_stddev_udaf)();
+        let foreign_stddev_func: Arc<dyn AggregateUDFImpl> = 
(&ffi_stddev_func).into();
+        assert_eq!(
+            foreign_stddev_func.distinct_handling(),
+            DistinctHandling::Unsupported
+        );
+

Review Comment:
   Added in d37014921. The test library now exposes `MIN` as `create_min_udaf`, 
and `test_foreign_min_distinct_drops_distinct` runs `MIN(DISTINCT b)` grouped 
by `a` through the foreign UDAF. It checks the result and that the optimized 
plan is a single `Aggregate` with `min(?table?.b)`, so no `DISTINCT` and no 
extra dedup aggregate.
   
   I also ran it with the forwarding change reverted. It fails there because 
the plan keeps `min(DISTINCT ?table?.b)`.



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