Struct arrow2::array::UnionArray

source ·
pub struct UnionArray { /* private fields */ }
Expand description

UnionArray represents an array whose each slot can contain different values.

Implementations§

constructs a new iterator

Returns a new UnionArray.

Errors

This function errors iff:

  • data_type’s physical type is not crate::datatypes::PhysicalType::Union.
  • the fields’s len is different from the data_type’s children’s length
  • The number of fields is larger than i8::MAX
  • any of the values’s data type is different from its corresponding children’ data type

Returns a new UnionArray.

Panics

This function panics iff:

  • data_type’s physical type is not crate::datatypes::PhysicalType::Union.
  • the fields’s len is different from the data_type’s children’s length
  • any of the values’s data type is different from its corresponding children’ data type

Creates a new null UnionArray.

Creates a new empty UnionArray.

Boxes self into a Box<dyn Array>.

Boxes self into a std::sync::Arc<dyn Array>.

Returns a slice of this UnionArray.

Implementation

This operation is O(F) where F is the number of fields.

Panic

This function panics iff offset + length >= self.len().

Returns a slice of this UnionArray.

Implementation

This operation is O(F) where F is the number of fields.

Safety

The caller must ensure that offset + length <= self.len().

Returns the length of this array

The optional offsets.

The fields.

The types.

Returns the index and slot of the field to select from self.fields.

Returns the index and slot of the field to select from self.fields. The first value is guaranteed to be < self.fields().len()

Safety

This function is safe iff index < self.len.

Returns the slot index as a Scalar.

Panics

iff index >= self.len()

Returns the slot index as a Scalar.

Safety

This function is safe iff i < self.len.

Returns all fields from DataType::Union.

Panic

Panics iff data_type’s logical type is not DataType::Union.

Returns whether the DataType::Union is sparse or not.

Panic

Panics iff data_type’s logical type is not DataType::Union.

Trait Implementations§

Converts itself to a reference of Any, which enables downcasting to concrete types.
Converts itself to a mutable reference of Any, which enables mutable downcasting to concrete types.
The length of the Array. Every array has a length corresponding to the number of elements (slots).
The DataType of the Array. In combination with Array::as_any, this can be used to downcast trait objects (dyn Array) to concrete arrays.
The validity of the Array: every array has an optional Bitmap that, when available specifies whether the array slot is valid or not (null). When the validity is None, all slots are valid.
Slices the Array, returning a new Box<dyn Array>. Read more
Slices the Array, returning a new Box<dyn Array>. Read more
Clones this Array with a new new assigned bitmap. Read more
Clone a &dyn Array to an owned Box<dyn Array>.
whether the array is empty
The number of null slots on this Array. Read more
Returns whether slot i is null. Read more
Returns whether slot i is valid. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.