Skip to content

fix(parquet): import DECIMAL columns as Vortex decimals - #632

Merged
dfa1 merged 1 commit into
mainfrom
fix/628-parquet-decimal
Nov 1, 2026
Merged

dfa1 merged 1 commit into
mainfrom
fix/628-parquet-decimal

Conversation

@dfa1

@dfa1 dfa1 commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Closes #628.

A Parquet DECIMAL annotates INT32, INT64, FIXED_LEN_BYTE_ARRAY or BYTE_ARRAY. ParquetImporter mapped the integer forms to plain I32/I64, dropping the scale (17.00 imported as 1700), and threw on the byte-array forms. Every form now maps to DType.Decimal with the annotation's precision and scale, read through hardwood's getDecimal.

A DECIMAL nested in a LIST/STRUCT, which was silently truncated through Number, now fails at the import's start until the nested builders carry BigDecimal (documented in docs/reference.md).

Tests

  • ParquetImporterTest$Decimals: all four physical encodings, nullable, negative and fractional values.
  • ColumnBuilderTest#nestedDecimal_throwsAtConstruction
  • ParquetImportInteropIntegrationTest#decimalWithNulls_jniReadsImportedFile: vortex-jni reads the imported file with Arrow's decimal type at the same precision/scale (full, filtered, row-range), including precision 50 (i256); fails without the fix.

Real data (Raincloud): duckdb-tpch-sf1-lineitem (DECIMAL(15,2) as a 7-byte FIXED_LEN_BYTE_ARRAY) now imports with the dtypes the vortex-jni file has; its CSV export is byte-identical.

🤖 Generated with Claude Code

A Parquet DECIMAL annotates INT32, INT64, FIXED_LEN_BYTE_ARRAY or
BYTE_ARRAY. ParquetImporter mapped the integer forms to plain I32/I64,
dropping the scale (17.00 imported as 1700), and threw on the byte-array
forms. Every form now maps to DType.Decimal with the annotation's precision
and scale, read through hardwood's getDecimal.

A DECIMAL nested in a LIST/STRUCT, which was truncated through Number, now
fails at the import's start until the nested builders carry BigDecimal.

Found by the Raincloud corpus: duckdb-tpch-sf1-lineitem (DECIMAL(15,2) as a
7-byte FIXED_LEN_BYTE_ARRAY) now imports with the dtypes the vortex-jni file
has, and its CSV export is byte-identical.

Closes #628

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dfa1
dfa1 merged commit 4cf2aa6 into main Nov 1, 2026
6 checks passed
@dfa1
dfa1 deleted the fix/628-parquet-decimal branch November 1, 2026 18:40
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.

ParquetImporter: DECIMAL columns are rejected, or imported as plain integers without their scale

1 participant