Skip to content

fix(transform): preserve decimal types in truncate projections - #2893

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix-decimal-truncate-scale
Open

fix(transform): preserve decimal types in truncate projections#2893
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix-decimal-truncate-scale

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A. Found while auditing truncate transforms and predicate projection.

What changes are included in this PR?

Decimal truncate operations rebuilt transformed values as scale-0 decimals with maximum precision. That changed the literal type and made projected predicates display raw mantissas, such as 10000 instead of 100.00.

This PR preserves the source precision and scale when:

  • transforming decimal literals with truncate
  • adjusting inclusive projection boundaries
  • incrementing or decrementing strict projection boundaries

Projected literals now retain the decimal type of the source expression.

Are these changes tested?

Yes. Regression coverage verifies that decimal truncation and boundary adjustment preserve the original type. Existing strict and inclusive projection tests also verify scaled predicate values.

Validated with:

  • cargo test -p iceberg --lib
  • cargo clippy -p iceberg --lib -- -D warnings

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.

1 participant