From f12b3db9c3a0507ed0bc7984ce0e290be0ca9e2d Mon Sep 17 00:00:00 2001 From: Michael J Ward Date: Thu, 25 Jul 2024 03:20:54 -0500 Subject: [PATCH] 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 b39b1955bb07..32ca05b8cdd9 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 7a4de4f61a38..9c81c4852783 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)),