Skip to main content

pack_struct_to_dictionary

Function pack_struct_to_dictionary 

Source
fn pack_struct_to_dictionary<K: ArrowDictionaryKeyType>(
    array: &dyn Array,
    dict_value_type: &DataType,
    cast_options: &CastOptions<'_>,
) -> Result<ArrayRef, ArrowError>
Expand description

Wrap a struct-valued array as a DictionaryArray<K, Struct> with identity keys [0, 1, ..., len-1]. Unlike the primitive / byte packers above, no deduplication is performed, since struct values have no general hash/equality builder in arrow-rs.

Each child field of the source is recursively cast to the matching field of dict_value_type via cast_with_options before keys are emitted. If any child cast fails, the whole pack fails, the same contract as the primitive packers above.