In Parquet, an array (or repeatable field) is a column that can contain multiple values per row.
Declaration
You declare an array by specifying IEnumerable<T> as the type in a DataField:
var field = new DataField<IEnumerable<int>>("items");
Alternatively, you can set isArray: true in the DataField constructor.
Writing Arrays
When writing to an array field, you must provide both the flattened data values and the repetition levels to indicate where new lists start.
Warning: While supported, using arrays instead of lists is strongly discouraged due to poor compatibility with other systems and lack of support for schema evolution.
Checking for Arrays
You can check if a field is repeatable by inspecting the .IsArray boolean property.
// Declare a repeatable field
var field = new DataField<IEnumerable<int>>("items");
// Writing data with repetition levels
// Data: [1, 2, 3, 4, 5] representing [[1, 2, 3], [4, 5]]
// RL: [0, 1, 1, 0, 1] (0 starts a new list, 1 continues current list)
await groupWriter.WriteAsync<int>(field, new int[] { 1, 2, 3, 4, 5 }, new int[] { 0, 1, 1, 0, 1 });