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
Support decimal casting in Parquet #2823
Merged
Merged
Conversation
This file contains 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
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
6 times, most recently
from
February 14, 2020 11:48
5da854a
to
2d32ebc
Compare
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
2 times, most recently
from
February 20, 2020 16:09
4df795e
to
c537673
Compare
wendigo
changed the title
Support decimal rescaling in Parquet
Support decimal casting in Parquet
Feb 20, 2020
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
from
February 20, 2020 16:39
c537673
to
63844e8
Compare
aalbu
reviewed
Feb 20, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I like the tests.
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
5 times, most recently
from
February 21, 2020 11:26
fda3390
to
8363fb5
Compare
findepi
reviewed
Feb 21, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Editorial comments
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/ParquetDecimalScalingTest.java
Outdated
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
4 times, most recently
from
February 23, 2020 19:25
c53a53a
to
5070b1b
Compare
findepi
reviewed
Feb 26, 2020
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/TestParquetDecimalScaling.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/TestParquetDecimalScaling.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/TestParquetDecimalScaling.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/TestParquetDecimalScaling.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/TestParquetDecimalScaling.java
Outdated
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/TestParquetDecimalScaling.java
Show resolved
Hide resolved
presto-hive/src/test/java/io/prestosql/plugin/hive/parquet/TestParquetDecimalScaling.java
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/LongDecimalColumnReader.java
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
2 times, most recently
from
February 26, 2020 14:08
90501fe
to
7ca75ea
Compare
findepi
reviewed
Feb 26, 2020
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
presto-parquet/src/main/java/io/prestosql/parquet/reader/ShortDecimalColumnReader.java
Outdated
Show resolved
Hide resolved
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
from
February 26, 2020 15:36
cb59e36
to
698b769
Compare
findepi
approved these changes
Feb 26, 2020
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
from
February 26, 2020 20:55
698b769
to
8766bf7
Compare
wendigo
force-pushed
the
parquet_decimal_rescaling
branch
from
February 27, 2020 13:18
8766bf7
to
34678fa
Compare
Merged, thanks! |
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.
Supports converting between ShortDecimals <-> LongDecimal when reading from Parquet Decimal column into Presto decimal column.
When Presto scale is < Parquet scale then value got rounded.
In every other case this code checks if converted value overflows Presto decimal type (if it does - exception is thrown) or got truncated on significant side (it it does - exception is thrown).