You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/12 19:48:01 UTC

[GitHub] [arrow-rs] alamb commented on a diff in pull request #2836: Handle empty offsets buffer (#1824)

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


##########
arrow-array/src/array/binary_array.rs:
##########
@@ -845,4 +852,22 @@ mod tests {
             .validate_full()
             .expect("All null array has valid array data");
     }
+
+    #[test]
+    fn test_empty_offsets() {
+        let string = BinaryArray::from(
+            ArrayData::builder(DataType::Binary)
+                .buffers(vec![Buffer::from(&[]), Buffer::from(&[])])
+                .build()
+                .unwrap(),
+        );
+        assert_eq!(string.value_offsets(), &[0]);
+        let string = LargeBinaryArray::from(

Review Comment:
   ```suggestion
           let string = LargeBinaryArray::from(
           assert_eq!(string.len(), 0);
   ```
   
   I suggest you add a test for `len()` as described in the original bug report.
   
   This comment applies to all the tests added in this PR



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org