etseidl commented on code in PR #8888:
URL: https://github.com/apache/arrow-rs/pull/8888#discussion_r2543984700


##########
parquet/src/encodings/decoding.rs:
##########
@@ -1688,6 +1692,21 @@ mod tests {
         test_delta_bit_packed_decode::<Int64Type>(data);
     }
 
+    #[test]
+    fn test_delta_bit_packed_zero_miniblocks() {
+        // It is invalid for mini_blocks_per_block to be 0
+        let data = vec![
+            128, 1, // block_size = 128
+            0,     // mini_blocks_per_block = 0
+        ];
+        let mut decoder = DeltaBitPackDecoder::<Int32Type>::new();
+        let err = decoder.set_data(data.into(), 0).unwrap_err();
+        assert_eq!(
+            err.to_string(),
+            "Parquet error: cannot have zero miniblock per block"

Review Comment:
   ```suggestion
               "Parquet error: cannot have zero miniblocks per block"
   ```



##########
parquet/src/encodings/decoding.rs:
##########
@@ -681,6 +681,10 @@ where
             .try_into()
             .map_err(|_| general_err!("invalid 'mini_blocks_per_block'"))?;
 
+        if self.mini_blocks_per_block == 0 {
+            return Err(general_err!("cannot have zero miniblock per block"));

Review Comment:
   ```suggestion
               return Err(general_err!("cannot have zero miniblocks per 
block"));
   ```



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