alamb commented on code in PR #9217:
URL: https://github.com/apache/arrow-rs/pull/9217#discussion_r2703025835


##########
parquet/src/arrow/record_reader/definition_levels.rs:
##########
@@ -160,9 +160,10 @@ impl DefinitionLevelDecoder for 
DefinitionLevelBufferDecoder {
                 let start = levels.len();
                 let (values_read, levels_read) = 
decoder.read_def_levels(levels, num_levels)?;
 
-                nulls.reserve(levels_read);
-                for i in &levels[start..] {
-                    nulls.append(i == max_level);
+                // Safety: slice iterator has a trusted length
+                unsafe {

Review Comment:
   Another thing that we could potentially try is to evaluate to a bitmap first 
and then append that bitmap directly via set_bits or something -- though now 
that I type this I am not sure that would be be any better 🤔 



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