Jefffrey commented on code in PR #11661:
URL: https://github.com/apache/arrow-rs/pull/11661#discussion_r4370254141
##########
arrow-array/src/ffi.rs:
##########
@@ -293,7 +293,19 @@ impl ImportedArrowArray<'_> {
};
let data_layout = layout(&self.data_type);
- let buffers = self.buffers(data_layout.can_contain_null_mask,
data_layout.variadic)?;
+ let mut buffers = self.buffers(data_layout.can_contain_null_mask,
data_layout.variadic)?;
+
+ // The values buffer of an empty array at offset 0 is imported as
empty (see
+ // `buffer_len`), so its lone offset, which can be any value, is reset
to 0.
+ if len == 0
+ && offset == 0
+ && matches!(
+ self.data_type,
+ DataType::Utf8 | DataType::Binary | DataType::LargeUtf8 |
DataType::LargeBinary
Review Comment:
can this occur for other types that have an offsets buffer, such as list,
largelist and map?
--
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]