Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions arrow-array/src/array/union_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ impl UnionArray {
}
}

/// Returns the [`UnionFields`] for the union.
pub fn fields(&self) -> &UnionFields {
match self.data_type() {
DataType::Union(fields, _) => fields,
_ => unreachable!("Union array's data type is not a union!"),
}
}

/// Returns whether the `UnionArray` is dense (or sparse if `false`).
pub fn is_dense(&self) -> bool {
match self.data_type() {
Expand Down
Loading