Skip to content

Conversation

@asolimando
Copy link
Contributor

Adds explicit DECIMAL type handling in SubstraitTypeSystem to ensure maximum precision and scale of 38, consistent with the Substrait specification.

Substrait specifies DECIMAL max precision/scale as 38, while Calcite's default is 19. Previously relied on deprecated methods getMaxNumericPrecision() and getMaxNumericScale() (deprecated in Calcite 1.38.0, will be made final in 1.42.0).

This change migrates to the new API pattern using getMaxPrecision(SqlTypeName) and getMaxScale(SqlTypeName).

Fixes #655

@CLAassistant
Copy link

CLAassistant commented Jan 2, 2026

CLA assistant check
All committers have signed the CLA.

@asolimando asolimando force-pushed the main-issue_655_decimal_type branch from 27de37b to a21deb8 Compare January 2, 2026 19:57
@bestbeforetoday bestbeforetoday changed the title feat: improve DECIMAL type handling (#655) feat: improve DECIMAL type handling Jan 3, 2026
Copy link
Member

@nielspardon nielspardon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for improving this

@nielspardon nielspardon merged commit bce3e73 into substrait-io:main Jan 5, 2026
13 checks passed
@asolimando asolimando deleted the main-issue_655_decimal_type branch January 5, 2026 09:42
mbwhite pushed a commit to mbwhite/substrait-java that referenced this pull request Jan 9, 2026
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.

Improve DECIMAL type handling

3 participants