Skip to content
Discussion options

You must be logged in to vote

I figured it out!

For everyone else running into this issue:

First, add this function to convert from StructArray to &dyn Array:

fn convert_struct_array_to_dyn_array(msg: &StructArray) -> &dyn Array {
    msg
}

Then use it to convert your values into a Vec<&dyn Array>:

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:

let concat_values = = concat(converted_values.as_slice()).unwrap();

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

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SirRocket
Comment options

@SirRocket
Comment options

Answer selected by SirRocket
@Jefffrey
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants