friendlymatthew commented on code in PR #7878:
URL: https://github.com/apache/arrow-rs/pull/7878#discussion_r2200764186
##########
parquet-variant/src/decoder.rs:
##########
@@ -200,6 +200,24 @@ impl OffsetSizeBytes {
}
}
+pub(crate) fn map_bytes_to_offsets(
Review Comment:
Oof, the screenshot should've showed the codegen for `chunks_exact`.
`chunks_exact` would never panic. If the slice length that we want to chunk
over is not evenly divided by the chunk size, it will omit the remainder
elements and can be retrieved by calling `remainder()` from the iterator.
More formally, `ChunksExact` will return `array.len() // chunk_length`
elements. `ChunksExact::remainder` will return a slice with `array.len() %
chunk_length` elements.
`chunks` _would_ risk a panic if the slice length is not evenly divided by
the chunk size. Since, the remainder is directly appended as the last slice in
the iterator.
--
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]