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
Row-group stats decode aborts the read on minimum-length BYTE_ARRAY decimal bounds #3280
get_parquet_stat_min_as_datum / get_parquet_stat_max_as_datum in crates/iceberg/src/arrow/schema.rs decode BYTE_ARRAY decimal statistics with a strict 16-byte conversion:
Parquet stores BYTE_ARRAY decimals as variable-length, minimal-byte-count, big-endian two's-complement values, so a bound shorter than 16 bytes (the common case) makes try_into() error and the ? propagates it, aborting the entire row-group read before scan planning completes.
The FIXED_LEN_BYTE_ARRAY decimal arm immediately below already handles this correctly with the variable-length helper i128_from_be_bytes(bytes) and a graceful DataInvalid error. The BYTE_ARRAY arm should use the same path (both min and max sites).
This is the row-group counterpart to the page-index behavior in #3247: that PR degraded the same malformed-bound class to "skip pruning" at the page-index layer, but the row-group stats layer still hard-errors, so "a malformed bound aborts the read" is not closed end-to-end.
From format/spec.md:1549 (the Parquet physical-type mapping):
decimal(P,S) → P <= 9: int32, P <= 18: int64, fixed otherwise
Fixed must use the minimum number of bytes that can store P.
So the spec mandates exactly three encodings: int32, int64, or fixed (FIXED_LEN_BYTE_ARRAY, chosen by precision. binary/BYTE_ARRAY is not a conformant decimal encoding in Iceberg. So this is purely a defensive fix and lower priority.
To Reproduce
No response
Expected behavior
Fix direction: replace i128::from_be_bytes(bytes.try_into()?) with i128_from_be_bytes(bytes) (as the FIXED_LEN arm does) at both the min and max decimal-BYTE_ARRAY sites, and add regression coverage for a sub-16-byte BYTE_ARRAY decimal bound.
Activity
fix(arrow): decode short BYTE_ARRAY decimal row-group stats (apache#3364