mbutrovich commented on issue #12467:
URL: https://github.com/apache/arrow-rs/issues/12467#issuecomment-7170613952

   > I wonder if we should roll up some of the ULEB and zigzag decoding as well 
🤔 That seems to repeat throughout the various crates.
   
   I think it fits. It needs no Arrow types, parquet needs it without the 
`arrow` feature, and parquet already keeps it in `util/bit_util.rs`. The three 
decoders disagree on an overlong varint:
   
   - arrow-avro 
[`read_varint`](https://github.com/apache/arrow-rs/blob/8befa3cd899afea17b1969f0f4fd4491e3f81439/arrow-avro/src/reader/vlq.rs#L49-L60)
 returns `None`.
   - parquet 
[`read_vlq`](https://github.com/apache/arrow-rs/blob/8befa3cd899afea17b1969f0f4fd4491e3f81439/parquet/src/parquet_thrift.rs#L296-L312)
 shifts with `wrapping_shl` and returns a wrong value.
   - parquet 
[`BitReader::get_vlq_int`](https://github.com/apache/arrow-rs/blob/8befa3cd899afea17b1969f0f4fd4491e3f81439/parquet/src/util/bit_util.rs#L1164-L1186)
 panics on an `assert!`. It reads RLE run headers and `DELTA_BINARY_PACKED` 
headers.
   
   The encoders are copied the same way 
([avro](https://github.com/apache/arrow-rs/blob/8befa3cd899afea17b1969f0f4fd4491e3f81439/arrow-avro/src/writer/encoder.rs#L60-L74),
 
[`BitWriter`](https://github.com/apache/arrow-rs/blob/8befa3cd899afea17b1969f0f4fd4491e3f81439/parquet/src/util/bit_util.rs#L758-L781),
 
[thrift](https://github.com/apache/arrow-rs/blob/8befa3cd899afea17b1969f0f4fd4491e3f81439/parquet/src/parquet_thrift.rs#L867-L880)).
   


-- 
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]

Reply via email to