diff --git a/src/io/parquet/write/nested/rep.rs b/src/io/parquet/write/nested/rep.rs index 4281a6301e1..744fab39ecc 100644 --- a/src/io/parquet/write/nested/rep.rs +++ b/src/io/parquet/write/nested/rep.rs @@ -15,7 +15,7 @@ fn iter<'a>(nested: &'a [Nested]) -> Vec> { Some(Box::new(to_length(nested.offsets)) as Box) } Nested::Struct(_, _, length) => { - Some(Box::new(std::iter::repeat(0usize).take(*length)) as Box) + Some(Box::new(std::iter::repeat(1usize).take(*length)) as Box) } }) .collect() @@ -202,4 +202,25 @@ mod tests { test(nested, expected) } + + #[test] + fn list_of_struct() { + /* + [ + [{"a": "b"}],[{"a": "c"}] + ] + */ + let nested = vec![ + Nested::List(ListNested { + is_optional: true, + offsets: &[0i32, 1, 2], + validity: None, + }), + Nested::Struct(None, true, 2), + Nested::Primitive(None, true, 2), + ]; + let expected = vec![0, 0]; + + test(nested, expected) + } }