Fix DECIMAL scale parsing bug in Trino-to-Rel converter#582
Open
Fix DECIMAL scale parsing bug in Trino-to-Rel converter#582
Conversation
…#453) The scale parameter in DECIMAL(precision, scale) was incorrectly reading from the first argument (index 0) instead of the second argument (index 1), causing CAST(a AS DECIMAL(38,4)) to be parsed as DECIMAL(38,38). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update copyright years to 2021-2026 - Add test cases for DECIMAL(18,9), DECIMAL(1,0), DECIMAL(38,38) - Apply spotless formatting
Product test case expected outputs had decimal(p, p) due to the bug where scale was read from the same argument as precision. Updated 11 expected files to use the correct decimal(p, s) values.
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.
Summary
CAST(a AS DECIMAL(38,4))was incorrectly parsed asDECIMAL(38,38)ParseTreeBuilder.javawheregetArguments().get(0)was used for the scale parameter instead ofgetArguments().get(1)Testing Done
TrinoToRelConverterTestforDECIMAL(38,4)andDECIMAL(10)./gradlew clean buildpasses (547 tasks, all tests green)