How to build an Apache Arrow message containing a list of structs with arrow-rs?

Viewed 123

I'm using the arrow-rs crate (version 4.4) to declared the following schema:

Schema::new(vec![
            Field::new("name", DataType::Utf8, false),
            Field::new("attributes", DataType::List(
                Box::new(Field::new(
                    "attr",
                    DataType::Struct(vec![
                        Field::new("name", DataType::Utf8, false),
                        Field::new("value", DataType::Utf8, false),
                    ]),
                    true,
                ))
            ), true),
])

I'm struggling to find a complete example building a record batch from this type of schema containing a list of structs.

0 Answers
Related