pyarrow.sparse_union#

pyarrow.sparse_union(child_fields,type_codes=None)#

Create SparseUnionType from child fields.

A sparse union is a nested type where each logical value is taken froma single child. A buffer of 8-bit type ids indicates which childa given logical value is to be taken from.

In a sparse union, each child array should have the same length as theunion array, regardless of the actual number of union values thatrefer to it.

Parameters:
child_fieldssequence ofField values

Each field must have a UTF8-encoded name, and these field names arepart of the type metadata.

type_codeslist ofintegers, defaultNone
Returns:
typeSparseUnionType