Module arrow2::array [−][src]
Expand description
Contains the Array
and MutableArray
trait objects declaring arrays,
as well as concrete arrays (such as Utf8Array
and MutableUtf8Array
).
Fixed-length containers with optional values
that are layed in memory according to the Arrow specification.
Each array type has its own struct
. The following are the main array types:
PrimitiveArray
andMutablePrimitiveArray
, an array of values with a fixed length such as integers, floats, etc.BooleanArray
andMutableBooleanArray
, an array of boolean values (stored as a bitmap)Utf8Array
andMutableUtf8Array
, an array of variable length utf8 valuesBinaryArray
andMutableBinaryArray
, an array of opaque variable length valuesListArray
andMutableListArray
, an array of arrays (e.g.[[1, 2], None, [], [None]]
)StructArray
, an array of arrays identified by a string (e.g.{"a": [1, 2], "b": [true, false]}
) All immutable arrays implement the trait objectArray
and that can be downcasted to a concrete struct based onPhysicalType
available fromArray::data_type
. All immutable arrays are backed byBuffer
and thus cloning and slicing them isO(1)
.
Most arrays contain a MutableArray
counterpart that is neither clonable nor slicable, but
can be operated in-place.
Modules
Contains functions and function factories to order values within arrays.
Structs
A BinaryArray
is a nullable array of bytes - the Arrow equivalent of Vec<Option<Vec<u8>>>
.
The Arrow’s equivalent to an immutable Vec<Option<bool>>
, but with 1/16
of its size.
Cloning and slicing this struct is O(1)
.
The Arrow’s equivalent to an immutable Vec<Option<[u8; size]>>
.
Cloning and slicing this struct is O(1)
.
The Arrow’s equivalent to an immutable Vec<Option<[T; size]>>
where T
is an Arrow type.
Cloning and slicing this struct is O(1)
.
An array representing a (key, value), both of arbitrary logical types.
The Arrow’s equivalent to Vec<Option<Vec<u8>>>
.
Converting a MutableBinaryArray
into a BinaryArray
is O(1)
.
The Arrow’s equivalent to Vec<Option<bool>>
, but with 1/16
of its size.
Converting a MutableBooleanArray
into a BooleanArray
is O(1)
.
A mutable, strong-typed version of DictionaryArray
.
The Arrow’s equivalent to a mutable Vec<Option<[u8; size]>>
.
Converting a MutableFixedSizeBinaryArray
into a FixedSizeBinaryArray
is O(1)
.
The mutable version of FixedSizeListArray
.
The mutable version of ListArray
.
The Arrow’s equivalent to Vec<Option<T>>
where T
is byte-size (e.g. i32
).
Converting a MutablePrimitiveArray
into a PrimitiveArray
is O(1)
.
The mutable version of Utf8Array
. See MutableArray
for more details.
The concrete Array
of DataType::Null
.
A PrimitiveArray
is arrow’s equivalent to Vec<Option<T: NativeType>>
, i.e.
an array designed for highly performant operations on optionally nullable slots,
backed by a physical type of a fixed byte-width, such as i32
or f64
.
The size of this struct is O(1)
as all data is stored behind an std::sync::Arc
.
A StructArray
is a nested Array
with an optional validity representing
multiple Array
with the same number of rows.
UnionArray
represents an array whose each slot can contain different values.
A Utf8Array
is arrow’s equivalent of an immutable Vec<Option<String>>
.
Cloning and slicing this struct is O(1)
.
Iterator of values of an Utf8Array
.
Traits
A trait representing an immutable Arrow array. Arrow arrays are trait objects
that are infalibly downcasted to concrete types according to the Array::data_type
.
Trait denoting NativeType
s that can be used as keys of a dictionary.
Trait describing how a struct imports into itself from the C data interface (FFI).
Trait that BinaryArray
and Utf8Array
implement for the purposes of DRY.
Trait that list arrays implement for the purposes of DRY.
A trait describing a mutable array; i.e. an array whose values can be changed.
Mutable arrays are not Send + Sync
and cannot be cloned but can be mutated in place,
thereby making them useful to perform numeric operations without allocations.
As in Array
, concrete arrays (such as MutablePrimitiveArray
) implement how they are mutated.
Trait describing types that can be used as offsets as per Arrow specification.
This trait is only implemented for i32
and i64
, the two sizes part of the specification.
Trait describing how a struct presents itself to the C data interface (FFI).
A trait describing the ability of a struct to create itself from a iterator.
This is similar to Extend
, but accepted the creation to error.
A trait describing the ability of a struct to receive new items.
Functions
Returns a function of index returning the string representation of the item of array
.
This outputs an empty string on nulls.
Creates a new Array
with a Array::len
of 0.
Creates a new Array
of DataType
data_type
and length
.
The array is guaranteed to have Array::null_count
equal to Array::len
for all types except Union, which does not have a validity.
Type Definitions
A type definition PrimitiveArray
for days_ms
A type definition MutablePrimitiveArray
for days_ms
A type definition PrimitiveArray
for f32
A type definition MutablePrimitiveArray
for f32
A type definition PrimitiveArray
for f64
A type definition MutablePrimitiveArray
for f64
A type definition PrimitiveArray
for i8
A type definition MutablePrimitiveArray
for i8
A type definition PrimitiveArray
for i16
A type definition MutablePrimitiveArray
for i16
A type definition PrimitiveArray
for i32
A type definition MutablePrimitiveArray
for i32
A type definition PrimitiveArray
for i64
A type definition MutablePrimitiveArray
for i64
A type definition PrimitiveArray
for i128
A type definition MutablePrimitiveArray
for i128
A type definition PrimitiveArray
for months_days_ns
A type definition MutablePrimitiveArray
for months_days_ns
A type definition PrimitiveArray
for u8
A type definition MutablePrimitiveArray
for u8
A type definition PrimitiveArray
for u16
A type definition MutablePrimitiveArray
for u16
A type definition PrimitiveArray
for u32
A type definition MutablePrimitiveArray
for u32
A type definition PrimitiveArray
for u64
A type definition MutablePrimitiveArray
for u64