GitHub user SirRocket added a comment to the discussion: Converting a 
Vec<StructArray> to an arrow list type

I figured it out! 

For everyone else running into this issue:

First, add this function to convert from `StructArray` to `&dyn Array`:
```rust
fn convert_struct_array_to_dyn_array(msg: &StructArray) -> &dyn Array {
    msg
}
```
Then use it to convert your values into a `Vec<&dyn Array>`:
```rust
let values: Vec<StructArray> = todo!();
let converted_values: Vec<&dyn Array> =
                        
values.iter().map(convert_struct_array_to_dyn_array).collect();
```
And then pass them to concat and the FixedSizedList:
```rust
let concat_values = = concat(converted_values.as_slice()).unwrap();

let list = FixedSizeListArray::new(field, concat_values.len() as i32, 
concat_values, None);
```

GitHub link: 
https://github.com/apache/arrow-rs/discussions/12413#discussioncomment-19829762

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to