pitrou commented on a change in pull request #9778:
URL: https://github.com/apache/arrow/pull/9778#discussion_r607015330
##########
File path: rust/arrow/src/array/ffi.rs
##########
@@ -55,11 +64,45 @@ impl TryFrom<ArrayData> for ffi::ArrowArray {
type Error = ArrowError;
fn try_from(value: ArrayData) -> Result<Self> {
+ // If parent is nullable, then children also must be nullable
+ // so we pass this nullable to the creation of hte child data
+ let nullable = match value.data_type() {
+ DataType::List(field) => field.is_nullable(),
+ DataType::LargeList(field) => field.is_nullable(),
+ _ => false,
+ };
+
let len = value.len();
let offset = value.offset() as usize;
let null_count = value.null_count();
let buffers = value.buffers().to_vec();
let null_buffer = value.null_buffer().cloned();
+ let child_data = value
+ .child_data()
+ .iter()
+ .map(|arr| {
+ let len = arr.len();
Review comment:
Well, you'll need to handle recursive types more generally anyway. Think
`list(list(int8))`.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]