anoopj opened a new issue, #3280:
URL: https://github.com/apache/iceberg-rust/issues/3280

   ### Apache Iceberg Rust version
   
   main@119fad92c891c95a7819d87e4195407b3f7c0578
   
   ### Describe the bug
   
   
   Surfaced during https://github.com/apache/iceberg-rust/pull/3247 (companion 
to #3264).
   
   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:
   
   ```
   PrimitiveLiteral::Int128(i128::from_be_bytes(bytes.try_into()?)),
   ```
   
   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.
   
   
   
   ### 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.
   
   
   ### Willingness to contribute
   
   I can contribute a fix for this bug independently


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to