diff --git a/datafusion/expr/src/built_in_function.rs b/datafusion/expr/src/built_in_function.rs index 91e3acd0f7bb0..179d7c6ee1b63 100644 --- a/datafusion/expr/src/built_in_function.rs +++ b/datafusion/expr/src/built_in_function.rs @@ -26,9 +26,7 @@ use std::sync::{Arc, OnceLock}; use crate::signature::TIMEZONE_WILDCARD; use crate::type_coercion::binary::get_wider_type; use crate::type_coercion::functions::data_types; -use crate::{ - conditional_expressions, FuncMonotonicity, Signature, TypeSignature, Volatility, -}; +use crate::{FuncMonotonicity, Signature, TypeSignature, Volatility}; use arrow::datatypes::{DataType, Field, Fields, IntervalUnit, TimeUnit}; use datafusion_common::{exec_err, plan_err, DataFusionError, Result}; @@ -941,10 +939,9 @@ impl BuiltinScalarFunction { | BuiltinScalarFunction::ConcatWithSeparator => { Signature::variadic(vec![Utf8], self.volatility()) } - BuiltinScalarFunction::Coalesce => Signature::variadic( - conditional_expressions::SUPPORTED_COALESCE_TYPES.to_vec(), - self.volatility(), - ), + BuiltinScalarFunction::Coalesce => { + Signature::variadic_equal(self.volatility()) + } BuiltinScalarFunction::SHA224 | BuiltinScalarFunction::SHA256 | BuiltinScalarFunction::SHA384 diff --git a/datafusion/expr/src/conditional_expressions.rs b/datafusion/expr/src/conditional_expressions.rs index 1346825f054da..7a2bf4b6c44a0 100644 --- a/datafusion/expr/src/conditional_expressions.rs +++ b/datafusion/expr/src/conditional_expressions.rs @@ -22,25 +22,6 @@ use arrow::datatypes::DataType; use datafusion_common::{plan_err, DFSchema, Result}; use std::collections::HashSet; -/// Currently supported types by the coalesce function. -/// The order of these types correspond to the order on which coercion applies -/// This should thus be from least informative to most informative -pub static SUPPORTED_COALESCE_TYPES: &[DataType] = &[ - DataType::Boolean, - DataType::UInt8, - DataType::UInt16, - DataType::UInt32, - DataType::UInt64, - DataType::Int8, - DataType::Int16, - DataType::Int32, - DataType::Int64, - DataType::Float32, - DataType::Float64, - DataType::Utf8, - DataType::LargeUtf8, -]; - /// Helper struct for building [Expr::Case] pub struct CaseBuilder { expr: Option>,