Skip to content

test: ceil and floor works correctly for Decimal128#3847

Closed
kazuyukitanimura wants to merge 2 commits into
mainfrom
fix-1729
Closed

test: ceil and floor works correctly for Decimal128#3847
kazuyukitanimura wants to merge 2 commits into
mainfrom
fix-1729

Conversation

@kazuyukitanimura
Copy link
Copy Markdown
Contributor

@kazuyukitanimura kazuyukitanimura commented Mar 31, 2026

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 ceil and floor for 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#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?

@kazuyukitanimura kazuyukitanimura deleted the fix-1729 branch March 31, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Processing logic of the function ceil/floor for Decimal128 datatype seems to be wrong

1 participant