tustvold commented on code in PR #4081:
URL: https://github.com/apache/arrow-rs/pull/4081#discussion_r1171263822


##########
arrow-array/src/types.rs:
##########
@@ -1569,6 +1604,21 @@ impl<O: OffsetSizeTrait> ByteArrayType for 
GenericBinaryType<O> {
     } else {
         DataType::Binary
     };
+
+    fn validate(
+        offsets: &OffsetBuffer<Self::Offset>,
+        values: &Buffer,
+    ) -> Result<(), ArrowError> {
+        // offsets are guaranteed to be monotonically increasing and non-empty
+        let max_offset = offsets.last().unwrap().as_usize();
+        if values.len() < max_offset {
+            return Err(ArrowError::InvalidArgumentError(format!(
+                "Maximum offset of {max_offset} is larger than values of 
length {}",
+                values.len()

Review Comment:
   I think the phrasing before is grammatically more correct



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