AndreaBozzo commented on code in PR #10916:
URL: https://github.com/apache/arrow-rs/pull/10916#discussion_r3889381023


##########
arrow-array/src/ffi.rs:
##########
@@ -474,7 +474,15 @@ impl ImportedArrowArray<'_> {
                 length * (bits / 8)
             }
             (DataType::Utf8 | DataType::Binary, 2) => {
-                if self.array.is_empty() {
+                // For a zero-length array at offset 0 the sole offset 
describes no data,
+                // and producers do put an arbitrary value there -- see
+                // `test_empty_string_with_non_zero_offset`, whose lone offset 
is 123 over
+                // an empty values buffer -- so it must not be used as a 
length. Once the
+                // array offset is non-zero, the offsets up to and including 
`offset`
+                // describe real preceding elements whose bytes the values 
buffer still
+                // has to cover, so the length is read from the buffer as it 
is for a
+                // non-empty array.

Review Comment:
   sorry, i've removed the test ref



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