alamb commented on code in PR #7789:
URL: https://github.com/apache/arrow-rs/pull/7789#discussion_r2182912334
##########
arrow-row/src/lib.rs:
##########
@@ -758,7 +758,18 @@ impl RowConverter {
// SAFETY
// We have validated that the rows came from this [`RowConverter`]
// and therefore must be valid
- unsafe { self.convert_raw(&mut rows, validate_utf8) }
+ let result = unsafe { self.convert_raw(&mut rows, validate_utf8) }?;
+
+ for (i, row) in rows.iter().enumerate() {
+ if !row.is_empty() {
+ return Err(ArrowError::InvalidArgumentError(format!(
+ "Codecs {codecs:?} did not consume all bytes for row {i},
remaining bytes: {row:?}",
+ codecs = &self.codecs
+ )));
+ }
+ }
Review Comment:
I suggest we follow your suggestion to wrap this one with a `cfg!(test)`
given the potential (but inconclusive) performance difference and we can merge
this PR in
Thank you @findepi
--
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]