From b2231d8a2d4120e49bcf527f477f63d5e5fb863f Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Wed, 9 Feb 2022 13:08:39 +0800 Subject: [PATCH 1/3] move expr functions to datafusion-expr expr_fn --- datafusion-expr/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datafusion-expr/src/lib.rs b/datafusion-expr/src/lib.rs index 709fa634d52d..1d0837f5cff6 100644 --- a/datafusion-expr/src/lib.rs +++ b/datafusion-expr/src/lib.rs @@ -37,8 +37,8 @@ pub use columnar_value::{ColumnarValue, NullColumnarValue}; pub use expr::Expr; pub use expr_fn::col; pub use function::{ - AccumulatorFunctionImplementation, ReturnTypeFunction, ScalarFunctionImplementation, - StateTypeFunction, + AccumulatorFunctionImplementation, ReturnTypeFunction, ScalarFunctionImplementation, + StateTypeFunction, }; pub use literal::{lit, lit_timestamp_nano, Literal, TimestampLiteral}; pub use operator::Operator; From 7ba97e98f9128884ed2f84a168bfac20c93a79d3 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Wed, 9 Feb 2022 13:14:43 +0800 Subject: [PATCH 2/3] add module level comments --- datafusion-expr/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datafusion-expr/src/lib.rs b/datafusion-expr/src/lib.rs index 1d0837f5cff6..709fa634d52d 100644 --- a/datafusion-expr/src/lib.rs +++ b/datafusion-expr/src/lib.rs @@ -37,8 +37,8 @@ pub use columnar_value::{ColumnarValue, NullColumnarValue}; pub use expr::Expr; pub use expr_fn::col; pub use function::{ - AccumulatorFunctionImplementation, ReturnTypeFunction, ScalarFunctionImplementation, - StateTypeFunction, + AccumulatorFunctionImplementation, ReturnTypeFunction, ScalarFunctionImplementation, + StateTypeFunction, }; pub use literal::{lit, lit_timestamp_nano, Literal, TimestampLiteral}; pub use operator::Operator; From f9ed67aec59d0a9339ec210c508f862456f98089 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Wed, 9 Feb 2022 18:09:29 +0800 Subject: [PATCH 3/3] remove reference to physical plan in logical plan --- datafusion/src/logical_plan/expr.rs | 3 +-- datafusion/src/logical_plan/registry.rs | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/datafusion/src/logical_plan/expr.rs b/datafusion/src/logical_plan/expr.rs index ba853ee4aa74..f075aaa8f633 100644 --- a/datafusion/src/logical_plan/expr.rs +++ b/datafusion/src/logical_plan/expr.rs @@ -22,8 +22,6 @@ pub use super::Operator; use crate::error::Result; use crate::logical_plan::ExprSchemable; use crate::logical_plan::{DFField, DFSchema}; -use crate::physical_plan::udaf::AggregateUDF; -use crate::physical_plan::udf::ScalarUDF; use arrow::datatypes::DataType; use datafusion_common::DataFusionError; pub use datafusion_common::{Column, ExprSchema}; @@ -33,6 +31,7 @@ use datafusion_expr::BuiltinScalarFunction; pub use datafusion_expr::Expr; use datafusion_expr::StateTypeFunction; pub use datafusion_expr::{lit, lit_timestamp_nano, Literal}; +use datafusion_expr::{AggregateUDF, ScalarUDF}; use datafusion_expr::{ ReturnTypeFunction, ScalarFunctionImplementation, Signature, Volatility, }; diff --git a/datafusion/src/logical_plan/registry.rs b/datafusion/src/logical_plan/registry.rs index d9b1839881d8..f439a12f31a9 100644 --- a/datafusion/src/logical_plan/registry.rs +++ b/datafusion/src/logical_plan/registry.rs @@ -15,11 +15,9 @@ // specific language governing permissions and limitations // under the License. -use std::{collections::HashSet, sync::Arc}; - use crate::error::Result; -use crate::physical_plan::udaf::AggregateUDF; -use crate::physical_plan::udf::ScalarUDF; +use datafusion_expr::{AggregateUDF, ScalarUDF}; +use std::{collections::HashSet, sync::Arc}; /// A registry knows how to build logical expressions out of user-defined function' names pub trait FunctionRegistry {