test: ceil and floor works correctly for Decimal128#3848
Merged
Conversation
andygrove
reviewed
Mar 31, 2026
andygrove
reviewed
Apr 2, 2026
|
|
||
| -- Config: spark.comet.expression.Ceil.allowIncompatible=true | ||
| -- ConfigMatrix: parquet.enable.dictionary=false,true | ||
|
|
Member
There was a problem hiding this comment.
nit: It would be nice to add a decimal column to the SQL test data so that decimal ceil/floor is tested through the SQL file framework too. Something like adding a decimal(5,2) column to the test table
andygrove
approved these changes
Apr 2, 2026
Member
andygrove
left a comment
There was a problem hiding this comment.
LGTM with one suggestion. Thanks @kazuyukitanimura
Contributor
Author
|
Thanks @andygrove I have added decimal columns to ceil/floor sql |
Contributor
Author
|
Merged, thanks @andygrove |
vaibhawvipul
pushed a commit
to vaibhawvipul/datafusion-comet
that referenced
this pull request
Apr 4, 2026
## Which issue does this PR close? Closes apache#1729 ## Rationale for this change apache#1729 was opened due to PR apache#1728 (comment apache#1728 (comment)) Later apache#3675 disabled `ceil` and `floor` for decimals. However, the rust test cases added in apache#1728 are incorrect in my opinion. When spark `ceil`/`floor`, Spark changes precision and scale. And later result precision and scale are set at https://github.com/apache/datafusion-comet/blob/main/native/spark-expr/src/math_funcs/ceil.rs#L51 The output of `decimal_ceil_f` is intermediate result. Therefore. `decimal_ceil_f` is correct and the expected values of rust test cases are incorrect. ## What changes are included in this PR? Corrected the rust test cases. Enabled `ceil` and `floor` again ## How are these changes tested?
andygrove
pushed a commit
to andygrove/datafusion-comet
that referenced
this pull request
Apr 8, 2026
## Which issue does this PR close? Closes apache#1729 ## Rationale for this change apache#1729 was opened due to PR apache#1728 (comment apache#1728 (comment)) Later apache#3675 disabled `ceil` and `floor` for decimals. However, the rust test cases added in apache#1728 are incorrect in my opinion. When spark `ceil`/`floor`, Spark changes precision and scale. And later result precision and scale are set at https://github.com/apache/datafusion-comet/blob/main/native/spark-expr/src/math_funcs/ceil.rs#L51 The output of `decimal_ceil_f` is intermediate result. Therefore. `decimal_ceil_f` is correct and the expected values of rust test cases are incorrect. ## What changes are included in this PR? Corrected the rust test cases. Enabled `ceil` and `floor` again ## How are these changes tested?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #1729
Rationale for this change
#1729 was opened due to PR #1728 (comment #1728 (comment))
Later #3675 disabled
ceilandfloorfor decimals.However, the rust test cases added in #1728 are incorrect in my opinion. When spark
ceil/floor, Spark changes precision and scale. And later result precision and scale are set at https://github.com/apache/datafusion-comet/blob/main/native/spark-expr/src/math_funcs/ceil.rs#L51The output of
decimal_ceil_fis intermediate result. Therefore.decimal_ceil_fis correct and the expected values of rust test cases are incorrect.What changes are included in this PR?
Corrected the rust test cases. Enabled
ceilandflooragainHow are these changes tested?