You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/10/06 19:23:19 UTC

[arrow-datafusion] branch master updated: delete type coercion for scalar udf in the physical phase (#3735)

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

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 88eadc414 delete type coercion for scalar udf in the physical phase (#3735)
88eadc414 is described below

commit 88eadc4149c3ece1cc5813c6ee6f94c818630291
Author: Kun Liu <li...@apache.org>
AuthorDate: Fri Oct 7 03:23:12 2022 +0800

    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 74bcb4921..5aca1df8a 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<dyn PhysicalExpr>],
     input_schema: &Schema,
 ) -> Result<Arc<dyn PhysicalExpr>> {
-    // 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::<Result<Vec<_>>>()?;
@@ -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(),
     )))
 }