Skip to content

feat: support 2-argument ceil(value, scale) for Spark compatibility#21562

Open
SAY-5 wants to merge 1 commit intoapache:mainfrom
SAY-5:feat/ceil-two-arg-scale
Open

feat: support 2-argument ceil(value, scale) for Spark compatibility#21562
SAY-5 wants to merge 1 commit intoapache:mainfrom
SAY-5:feat/ceil-two-arg-scale

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 12, 2026

Extends ceil to accept an optional scale parameter for Spark compatibility: ceil(3.145, 2) returns 3.15.

Implementation is ceil(value * 10^scale) / 10^scale. Handles Float32/Float64 with Int64 scale, both scalar and array inputs.

Closes #21560

Extends the ceil function to accept an optional scale parameter,
matching Spark SQL behavior: ceil(value, scale) rounds up to the
specified number of decimal places.

Implementation: ceil(value, scale) = ceil(value * 10^scale) / 10^scale

Supports Float32 and Float64 with Int64 scale, both scalar and array.

Closes apache#21560
@github-actions github-actions bot added the functions Changes to functions implementation label Apr 12, 2026
@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented Apr 13, 2026

The cargo fmt and docs check failures need the full workspace to resolve locally. I can't run cargo fmt with a sparse checkout. If a maintainer could run cargo fmt --all and cargo doc to regenerate the function docs, that should clear both checks. Happy to rebase if needed.

@kumarUjjawal
Copy link
Copy Markdown
Contributor

The cargo fmt and docs check failures need the full workspace to resolve locally. I can't run cargo fmt with a sparse checkout.

I don't know what that means but you can run the fmt using ci/scripts/rust_fmt.sh similarly there is for the docs update ./dev/update_function_docs.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support 2-argument ceil(value, scale) for Spark

2 participants