Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass down precision/scale when casting to DECIMAL #191

Merged
merged 3 commits into from
Nov 5, 2021

Conversation

jongn
Copy link
Contributor

@jongn jongn commented Nov 3, 2021

Related Trino issue:
trinodb/trino#6450

When casting column to DECIMAL type, precision was not being preserved during the Hive -> Rel translation, resulting in default precision/scale of 10,0 respectively.

This PR is to pass the precision/scale in Hive -> Rel translation, if applicable.

@jongn jongn changed the title Cast decimal precision Pass down precision/scale when casting to DECIMAL Nov 3, 2021
@jongn
Copy link
Contributor Author

jongn commented Nov 4, 2021

@ljfgem PTAL if you get the chance, thanks!

@ljfgem
Copy link
Collaborator

ljfgem commented Nov 4, 2021

@jongn Thank you so much for fixing it.
Could you please also add the unit tests for coral-spark?

@jongn
Copy link
Contributor Author

jongn commented Nov 5, 2021

Thanks @ljfgem, added the spark tests.

I'll add corresponding Trino tests once this is merged.

Copy link
Collaborator

@ljfgem ljfgem 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 @jongn !
i-test passed

@ljfgem ljfgem merged commit 45d23b4 into linkedin:master Nov 5, 2021
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.

2 participants