Skip to content

Commit a0b4a6d

Browse files
committed
feat: Support planning ROUND(numeric, int)
1 parent 773cc5d commit a0b4a6d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

datafusion/core/src/physical_plan/functions.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,15 @@ fn signature(fun: &BuiltinScalarFunction) -> Signature {
672672
],
673673
fun.volatility(),
674674
),
675+
BuiltinScalarFunction::Round => Signature::one_of(
676+
vec![
677+
TypeSignature::Exact(vec![DataType::Float64]),
678+
TypeSignature::Exact(vec![DataType::Float32]),
679+
// NOTE: stub, won't execute
680+
TypeSignature::Exact(vec![DataType::Decimal(38, 10), DataType::Int32]),
681+
],
682+
fun.volatility(),
683+
),
675684
// math expressions expect 1 argument of type f64 or f32
676685
// priority is given to f64 because e.g. `sqrt(1i32)` is in IR (real numbers) and thus we
677686
// return the best approximation for it (in f64).

0 commit comments

Comments
 (0)