You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validate FIXED_LEN_BYTE_ARRAY type_length for DECIMAL and INTERVAL in Parquet → Arrow schema conversion #9984
Is your feature request related to a problem or challenge?
parquet/src/arrow/schema/primitive.rs::from_fixed_len_byte_array carries a long-standing TODO from PR #1682:
// TODO: This should check the type length for the decimal and interval types
PrimitiveTypeBuilder::build() properly enforces type_length constraints during schema construction (schema/types.rs:477 for INTERVAL, :565-580 for DECIMAL precision-vs-length), but schemas decoded directly from Thrift bypass these checks entirely. This allows the reader-side conversion to silently produce an Arrow type that doesn't match the actual on-disk layout when:
DECIMAL has a type_length outside 1..=32 — it silently routes through Decimal128 / Decimal256 using invalid parameters.
INTERVAL has a type_length != 12 — it silently returns Interval(DayTime) regardless.
The same function already handles FLOAT16 correctly by returning an error when type_length != 2.
Describe the solution you'd like
In from_fixed_len_byte_array, validate type_length mirroring the existing FLOAT16 pattern:
DECIMAL (logical and converted): require 1 <= type_length <= 32 (Decimal128 fits within 16 bytes; Decimal256 up to 32).
INTERVAL converted type: require type_length == 12 per the Parquet format spec.
Return ParquetError::General with a clear message stating the expected range/value and the actual value.
Describe alternatives you've considered
Replicating the builder's fuller precision-vs-length check on the reader side. Rejected: that duplicates PrimitiveTypeBuilder::check_decimal_precision_scale and unnecessarily expands the scope. Length-range validation alone is enough to catch the cases that produce a mismatched Arrow type.
Doing nothing and letting downstream Arrow construction fail later. Rejected: errors would surface far from the root cause, making troubleshooting much more difficult.
Activity
CynicDog commentedon May 16, 2026
take
Validate FIXED_LEN_BYTE_ARRAY length for DECIMAL and INTERVAL types (#…
Validate FIXED_LEN_BYTE_ARRAY length for DECIMAL and INTERVAL types (a…
alamb commentedon Jun 3, 2026
label_issue.pyautomatically added labels {'parquet'} from #9985