Module arrow2::array [−][src]
Expand description
This module contains arrays: fixed-length and immutable 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
, an array of values with a fixed length such as integers, floats, etc.BooleanArray
, an array of boolean values (stored as a bitmap)Utf8Array
, an array of utf8 valuesBinaryArray
, an array of binary valuesListArray
, 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]}
)
This module contains constructors and accessors to operate on the arrays.
All the arrays implement the trait Array
and are often trait objects.
Every array has a DataType
, which you can access with Array::data_type
.
This can be used to downcast_ref
a &dyn Array
to a concrete struct.
Arrays can share memory via crate::buffer::Buffer
and thus cloning and slicing is O(1)
.
This module also contains the mutable counterparts of arrays, that are neither clonable nor slicable, but that
can be operated in-place, such as MutablePrimitiveArray
and MutableUtf8Array
.
Modules
Contains the trait Growable
and corresponding concreate implementations, one per concrete array,
that offer the ability to create a new Array
out of slices of existing Array
s.
Contains functions and function factories to order values within arrays.
Structs
A BooleanArray
is arrow’s equivalent to Vec<Option<bool>>
, i.e.
an array designed for highly performant operations on optionally nullable booleans.
The size of this struct is O(1)
as all data is stored behind an Arc
.
An Array
whose values are encoded by keys. This Array
is useful when the cardinality of
values is low compared to the length of the Array
.
The mutable version of BinaryArray
.
The mutable version of BooleanArray
. See MutableArray
for more details.
A mutable, strong-typed version of DictionaryArray
.
The mutable version of ListArray
.
The mutable version of PrimitiveArray
. See MutableArray
for more details.
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 physical 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 Utf8Array
is arrow’s equivalent of Vec<Option<String>>
, i.e.
an array designed for highly performant operations on optionally nullable strings.
The size of this struct is O(1)
as all data is stored behind an Arc
.
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 describing any type that can be used to index a slot of an array.
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.
Functions
Clones a dynamic Array
.
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
.
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 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