fix(parquet/pqarrow): reject decimal overflow in integer columns - #1122
Draft
fallintoplace wants to merge 2 commits into
Draft
fix(parquet/pqarrow): reject decimal overflow in integer columns#1122fallintoplace wants to merge 2 commits into
fallintoplace wants to merge 2 commits into
Conversation
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.
Rationale for this change
The Parquet decimal integer conversion uses debug assertions for range checks. Those assertions are disabled in normal builds, so values outside the signed INT32 or INT64 range can be silently narrowed.
What changes are included in this PR?
Check signed range boundaries for Decimal128 and Decimal256 values before converting them to Parquet INT32 or INT64 columns, and return an error when a value does not fit.
Are these changes tested?
go test ./parquet/pqarrow -run TestDecimalIntegerOverflowAre there any user-facing changes?
Values that do not fit the target Parquet integer type now return an error instead of being truncated.