diegoQuinas opened a new pull request, #21710: URL: https://github.com/apache/datafusion/pull/21710
## Which issue does this PR close? Closes #21560 ## Rationale for this change The Spark `ceil` function supports an optional `scale` parameter that controls the decimal position to round up to. This was not yet implemented in datafusion-spark. ## What changes are included in this PR? - Updated `Signature` to accept 1 or 2 arguments, following the same pattern as `SparkRound` - Updated `return_type`: floats preserve their type when a scale is provided (instead of returning `Int64`); scale=0 preserves the original behavior - Added `get_scale()` helper to extract the optional scale argument, returning `None` for NULL scale (which produces a NULL result) - Added `ceil_float()` helper for ceiling floats at arbitrary decimal positions - Updated `spark_ceil_scalar` and `spark_ceil_array` to apply the scale ## Are these changes tested? Yes, unit tests covering: - Float64/Float32 scalar with positive scale, negative scale, zero scale, and NULL scale - Float64 array with scale - Existing 1-argument tests continue to pass ## Are there any user-facing changes? Yes — `ceil(expr, scale)` is now supported in addition to the existing `ceil(expr)`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
