flatten_struct_cols

Function flatten_struct_cols 

Source
fn flatten_struct_cols(
    input_batch: &[Arc<dyn Array>],
    schema: &SchemaRef,
    struct_column_indices: &HashSet<usize>,
) -> Result<RecordBatch>
Expand description

Given a set of struct column indices to flatten try converting the column in input into multiple subfield columns For example struct_col: [a: struct(item: int, name: string), b: int] with a batch {a: {item: 1, name: “a”}, b: 2}, {a: {item: 3, name: “b”}, b: 4] will be converted into {a.item: 1, a.name: “a”, b: 2}, {a.item: 3, a.name: “b”, b: 4}