jhorstmann commented on code in PR #9794:
URL: https://github.com/apache/arrow-rs/pull/9794#discussion_r3136482878


##########
parquet/src/encodings/decoding.rs:
##########
@@ -847,13 +847,7 @@ where
             self.values_left -= 1;
         }
 
-        let mini_block_batch_size = match T::T::PHYSICAL_TYPE {
-            Type::INT32 => 32,
-            Type::INT64 => 64,
-            _ => unreachable!(),
-        };
-
-        let mut skip_buffer = vec![T::T::default(); mini_block_batch_size];
+        let mut skip_buffer = vec![T::T::default(); 
self.values_per_mini_block];

Review Comment:
   `Vec::default()` + `Vec::try_reserve()` + `Vec::resize()` would be a way to 
handle allocation errors, but I think enforcing a smaller limit than available 
memory in `set_data` could be a good idea. I'm thinking something between 64k 
to 1million values.
   
   Maybe the `skip_buffer` could also be stored inside the struct and reused, 
to avoid allocations per skip.



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