Skip to main content

state_struct_array

Function state_struct_array 

Source
fn state_struct_array(
    state_fields: &Fields,
    arrays: Vec<ArrayRef>,
) -> Result<StructArray>
Expand description

Wraps the state arrays of an accumulator into a struct of the declared state fields.

The declared state type is derived from logical expressions, while the accumulator names nested fields after physical expressions. For example, array_agg(v ORDER BY ts) declares its orderings as List(Struct("ts": ..)) but produces List(Struct("ts@0": ..)). Arrays that differ only in nested field names are cast to the declared type; any other difference is an error.