Skip to content

Commit

Permalink
feat: Support planning ROUND(numeric, int)
Browse files Browse the repository at this point in the history
  • Loading branch information
MazterQyou committed Jan 26, 2024
1 parent 333e8de commit 2035cf4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions datafusion/core/src/physical_plan/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,15 @@ fn signature(fun: &BuiltinScalarFunction) -> Signature {
],
fun.volatility(),
),
BuiltinScalarFunction::Round => Signature::one_of(
vec![
TypeSignature::Exact(vec![DataType::Float64]),
TypeSignature::Exact(vec![DataType::Float32]),
// NOTE: stub, won't execute
TypeSignature::Exact(vec![DataType::Decimal(38, 10), DataType::Int32]),
],
fun.volatility(),
),
// math expressions expect 1 argument of type f64 or f32
// priority is given to f64 because e.g. `sqrt(1i32)` is in IR (real numbers) and thus we
// return the best approximation for it (in f64).
Expand Down

0 comments on commit 2035cf4

Please sign in to comment.