etseidl commented on code in PR #10725:
URL: https://github.com/apache/arrow-rs/pull/10725#discussion_r3807401431
##########
parquet/src/arrow/decoder/dictionary_index.rs:
##########
@@ -43,7 +43,14 @@ impl DictIndexDecoder {
/// Create a new [`DictIndexDecoder`] with the provided data page, the
number of levels
/// associated with this data page, and the number of non-null values (if
known)
pub fn new(data: Bytes, num_levels: usize, num_values: Option<usize>) ->
Result<Self> {
- let bit_width = data[0];
+ let bit_width = *data
+ .first()
+ .ok_or_else(|| general_err!("dictionary index page is empty"))?;
+ if bit_width > 32 {
Review Comment:
Maybe add a constant somewhere (`MAX_RLE_DICTIONARY_BIT_WIDTH` 🤷).
--
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]