Jefffrey commented on code in PR #11224:
URL: https://github.com/apache/arrow-rs/pull/11224#discussion_r4122950877
##########
arrow-row/src/variable.rs:
##########
@@ -356,6 +370,9 @@ fn decode_binary_view_inner<const VALIDATE_UTF8: bool>(
val.iter_mut().for_each(|o| *o = !*o);
}
+ // Checked above by `check_view_buffer_len`; not using
`u32::try_from`
+ // here keeps the check out of the per-row loop.
+ debug_assert!(u32::try_from(start_offset).is_ok());
Review Comment:
not sure this is strictly necessary
##########
arrow-row/src/variable.rs:
##########
@@ -309,10 +309,21 @@ pub fn decode_binary<I: OffsetSizeTrait>(
}
}
+/// Returns an error if `long_values_len` bytes of non-inlined values cannot be
+/// addressed by the `u32` offset of a view into a single data buffer
+fn check_view_buffer_len(long_values_len: usize) -> Result<(), ArrowError> {
Review Comment:
we can just inline it if its used only once
##########
arrow-row/src/variable.rs:
##########
@@ -435,3 +461,27 @@ pub fn decode_null_value(rows: &mut [&[u8]], options:
SortOptions) {
*row = &row[2..];
}
}
+
+#[cfg(test)]
+mod tests {
Review Comment:
these tests here arent particularly useful, so we can just omit here
--
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]