From 88eadc4149c3ece1cc5813c6ee6f94c818630291 Mon Sep 17 00:00:00 2001 From: Kun Liu Date: Fri, 7 Oct 2022 03:23:12 +0800 Subject: [PATCH] delete type coercion for scalar udf in the physical phase (#3735) --- datafusion/physical-expr/src/udf.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/datafusion/physical-expr/src/udf.rs b/datafusion/physical-expr/src/udf.rs index 74bcb4921eb3..5aca1df8a800 100644 --- a/datafusion/physical-expr/src/udf.rs +++ b/datafusion/physical-expr/src/udf.rs @@ -16,8 +16,6 @@ // under the License. //! UDF support - -use super::type_coercion::coerce; use crate::{PhysicalExpr, ScalarFunctionExpr}; use arrow::datatypes::Schema; use datafusion_common::Result; @@ -31,10 +29,7 @@ pub fn create_physical_expr( input_phy_exprs: &[Arc], input_schema: &Schema, ) -> Result> { - // coerce - let coerced_phy_exprs = coerce(input_phy_exprs, input_schema, &fun.signature)?; - - let coerced_exprs_types = coerced_phy_exprs + let input_exprs_types = input_phy_exprs .iter() .map(|e| e.data_type(input_schema)) .collect::>>()?; @@ -42,7 +37,7 @@ pub fn create_physical_expr( Ok(Arc::new(ScalarFunctionExpr::new( &fun.name, fun.fun.clone(), - coerced_phy_exprs, - (fun.return_type)(&coerced_exprs_types)?.as_ref(), + input_phy_exprs.to_vec(), + (fun.return_type)(&input_exprs_types)?.as_ref(), ))) }