Skip to content

Commit db0cbc1

Browse files
committed
remove coerce_types
1 parent ebb8ba3 commit db0cbc1

File tree

1 file changed

+0
-32
lines changed
  • datafusion/spark/src/function/math

1 file changed

+0
-32
lines changed

datafusion/spark/src/function/math/abs.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -79,38 +79,6 @@ impl ScalarUDFImpl for SparkAbs {
7979
fn invoke_with_args(&self, args: ScalarFunctionArgs) -> Result<ColumnarValue> {
8080
spark_abs(&args.args)
8181
}
82-
83-
fn coerce_types(&self, arg_types: &[DataType]) -> Result<Vec<DataType>> {
84-
if arg_types.len() != 1 {
85-
return Err(invalid_arg_count_exec_err("abs", (1, 1), arg_types.len()));
86-
}
87-
match &arg_types[0] {
88-
DataType::Null
89-
| DataType::UInt8
90-
| DataType::UInt16
91-
| DataType::UInt32
92-
| DataType::UInt64
93-
| DataType::Int8
94-
| DataType::Int16
95-
| DataType::Int32
96-
| DataType::Int64
97-
| DataType::Float32
98-
| DataType::Float64
99-
| DataType::Decimal128(_, _)
100-
| DataType::Decimal256(_, _) => Ok(vec![arg_types[0].clone()]),
101-
other => {
102-
if other.is_numeric() {
103-
Ok(vec![DataType::Float64])
104-
} else {
105-
Err(unsupported_data_type_exec_err(
106-
"abs",
107-
"Numeric Type",
108-
&arg_types[0],
109-
))
110-
}
111-
}
112-
}
113-
}
11482
}
11583

11684
macro_rules! scalar_compute_op {

0 commit comments

Comments
 (0)