diff --git a/datafusion/core/src/catalog_common/information_schema.rs b/datafusion/core/src/catalog_common/information_schema.rs index 1d4a3c15f7ca..604209e7ab29 100644 --- a/datafusion/core/src/catalog_common/information_schema.rs +++ b/datafusion/core/src/catalog_common/information_schema.rs @@ -406,6 +406,7 @@ fn get_udf_args_and_return_types( .into_iter() .map(|arg_types| { // only handle the function which implemented [`ScalarUDFImpl::return_type`] method + #[allow(deprecated)] let return_type = udf.return_type(&arg_types).ok().map(|t| t.to_string()); let arg_types = arg_types .into_iter() diff --git a/datafusion/expr/src/udf.rs b/datafusion/expr/src/udf.rs index 809c78f30eff..5cc0321b7493 100644 --- a/datafusion/expr/src/udf.rs +++ b/datafusion/expr/src/udf.rs @@ -173,7 +173,9 @@ impl ScalarUDF { /// its [`ScalarUDFImpl::return_type`] should raise an error. /// /// See [`ScalarUDFImpl::return_type`] for more details. + #[deprecated(since = "44.0.0", note = "Use return_type_from_exprs() instead")] pub fn return_type(&self, arg_types: &[DataType]) -> Result { + #[allow(deprecated)] self.inner.return_type(arg_types) } @@ -450,6 +452,7 @@ pub trait ScalarUDFImpl: Debug + Send + Sync { /// is recommended to return [`DataFusionError::Internal`]. /// /// [`DataFusionError::Internal`]: datafusion_common::DataFusionError::Internal + #[deprecated(since = "44.0.0", note = "Use `return_type_from_exprs` instead")] fn return_type(&self, arg_types: &[DataType]) -> Result; /// What [`DataType`] will be returned by this function, given the @@ -483,6 +486,7 @@ pub trait ScalarUDFImpl: Debug + Send + Sync { _schema: &dyn ExprSchema, arg_types: &[DataType], ) -> Result { + #[allow(deprecated)] self.return_type(arg_types) } @@ -756,6 +760,7 @@ impl ScalarUDFImpl for AliasedScalarUDFImpl { } fn return_type(&self, arg_types: &[DataType]) -> Result { + #[allow(deprecated)] self.inner.return_type(arg_types) } diff --git a/datafusion/functions/src/string/concat.rs b/datafusion/functions/src/string/concat.rs index 895a7cdbf308..10470e74ac20 100644 --- a/datafusion/functions/src/string/concat.rs +++ b/datafusion/functions/src/string/concat.rs @@ -305,6 +305,7 @@ pub fn simplify_concat(args: Vec) -> Result { _ => None, }) .collect(); + #[allow(deprecated)] ConcatFunc::new().return_type(&data_types) }?;