Skip to content

fix(parquet/pqarrow): reject decimal overflow when writing integers - #1161

Draft
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/parquet-decimal-write-overflow
Draft

fix(parquet/pqarrow): reject decimal overflow when writing integers#1161
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/parquet-decimal-write-overflow

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

When decimals are stored as Parquet integers, values outside the declared or physical precision can be narrowed to int32 or int64 without a runtime error. That can silently write a different value.

What changes are included in this PR?

Validate non-null Decimal128 and Decimal256 values against both their declared precision and the target integer precision before conversion, and return arrow.ErrInvalid when a value does not fit.

Are these changes tested?

Yes. The test covers Decimal128 and Decimal256 with both int32 and int64 Parquet storage. The full parquet/pqarrow package suite passes.

Are there any user-facing changes?

Invalid decimal arrays now return an error instead of producing corrupted integer values.

@fallintoplace
fallintoplace force-pushed the fix/parquet-decimal-write-overflow branch from 61e569b to 180883c Compare August 9, 2026 22:51
@fallintoplace
fallintoplace marked this pull request as ready for review August 9, 2026 22:51
@fallintoplace
fallintoplace marked this pull request as draft August 9, 2026 22:54
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.

1 participant