This is an automated email from the ASF dual-hosted git repository.

jayzhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new f12b3db9c3 fix: expose the fluent API fn for approx_distinct instead 
of the module (#11644)
f12b3db9c3 is described below

commit f12b3db9c3a0507ed0bc7984ce0e290be0ca9e2d
Author: Michael J Ward <[email protected]>
AuthorDate: Thu Jul 25 03:20:54 2024 -0500

    fix: expose the fluent API fn for approx_distinct instead of the module 
(#11644)
    
    * fix: expose the fluent API fn for approx_distinct instead of the module
    
    Fixes: https://github.com/apache/datafusion/issues/11643
    
    * add approx_distinct to roundtrip_expr_api test
    
    * lint: cargo fmt
---
 datafusion/functions-aggregate/src/lib.rs              | 2 +-
 datafusion/proto/tests/cases/roundtrip_logical_plan.rs | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/datafusion/functions-aggregate/src/lib.rs 
b/datafusion/functions-aggregate/src/lib.rs
index b39b1955bb..32ca05b8cd 100644
--- a/datafusion/functions-aggregate/src/lib.rs
+++ b/datafusion/functions-aggregate/src/lib.rs
@@ -90,7 +90,7 @@ use std::sync::Arc;
 
 /// Fluent-style API for creating `Expr`s
 pub mod expr_fn {
-    pub use super::approx_distinct;
+    pub use super::approx_distinct::approx_distinct;
     pub use super::approx_median::approx_median;
     pub use super::approx_percentile_cont::approx_percentile_cont;
     pub use 
super::approx_percentile_cont_with_weight::approx_percentile_cont_with_weight;
diff --git a/datafusion/proto/tests/cases/roundtrip_logical_plan.rs 
b/datafusion/proto/tests/cases/roundtrip_logical_plan.rs
index 7a4de4f61a..9c81c48527 100644
--- a/datafusion/proto/tests/cases/roundtrip_logical_plan.rs
+++ b/datafusion/proto/tests/cases/roundtrip_logical_plan.rs
@@ -67,7 +67,7 @@ use datafusion_expr::{
 };
 use datafusion_functions_aggregate::average::avg_udaf;
 use datafusion_functions_aggregate::expr_fn::{
-    array_agg, avg, bit_and, bit_or, bit_xor, bool_and, bool_or, corr,
+    approx_distinct, array_agg, avg, bit_and, bit_or, bit_xor, bool_and, 
bool_or, corr,
 };
 use datafusion_functions_aggregate::string_agg::string_agg;
 use datafusion_proto::bytes::{
@@ -717,6 +717,7 @@ async fn roundtrip_expr_api() -> Result<()> {
         var_pop(lit(2.2)),
         stddev(lit(2.2)),
         stddev_pop(lit(2.2)),
+        approx_distinct(lit(2)),
         approx_median(lit(2)),
         approx_percentile_cont(lit(2), lit(0.5)),
         approx_percentile_cont_with_weight(lit(2), lit(1), lit(0.5)),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to