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:
PrimitiveArrayandMutablePrimitiveArray, an array of values with a fixed length such as integers, floats, etc.BooleanArrayandMutableBooleanArray, an array of boolean values (stored as a bitmap)Utf8ArrayandMutableUtf8Array, an array of variable length utf8 valuesBinaryArrayandMutableBinaryArray, an array of opaque variable length valuesListArrayandMutableListArray, an array of arrays (e.g.[[1, 2], None, [], [None]])StructArrayandMutableStructArray, an array of arrays identified by a string (e.g.{"a": [1, 2], "b": [true, false]}) All immutable arrays implement the trait objectArrayand that can be downcasted to a concrete struct based onPhysicalTypeavailable fromArray::data_type. All immutable arrays are backed byBufferand 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§
- growable
- Contains the trait
Growableand corresponding concreate implementations, one per concrete array, that offer the ability to create a newArrayout of slices of existingArrays. - ord
- Contains functions and function factories to order values within arrays.
Structs§
- Array
Values Iter - Iterator of values of an [
ArrayAccessor]. - Binary
Array - A
BinaryArrayis Arrow’s semantically equivalent of an immutableVec<Option<Vec<u8>>>. It implementsArray. - Boolean
Array - A
BooleanArrayis Arrow’s semantically equivalent of an immutableVec<Option<bool>>. It implementsArray. - Dictionary
Array - An
Arraywhose values are stored as indices. ThisArrayis useful when the cardinality of values is low compared to the length of theArray. - Fixed
Size Binary Array - The Arrow’s equivalent to an immutable
Vec<Option<[u8; size]>>. Cloning and slicing this struct isO(1). - Fixed
Size List Array - The Arrow’s equivalent to an immutable
Vec<Option<[T; size]>>whereTis an Arrow type. Cloning and slicing this struct isO(1). - List
Array - An
Arraysemantically equivalent toVec<Option<Vec<Option<T>>>>with Arrow’s in-memory. - MapArray
- An array representing a (key, value), both of arbitrary logical types.
- Mutable
Binary Array - The Arrow’s equivalent to
Vec<Option<Vec<u8>>>. Converting aMutableBinaryArrayinto aBinaryArrayisO(1). - Mutable
Binary Values Array - A
MutableArraythat builds aBinaryArray. It differs fromMutableBinaryArrayin that it builds non-nullBinaryArray. - Mutable
Boolean Array - The Arrow’s equivalent to
Vec<Option<bool>>, but with1/16of its size. Converting aMutableBooleanArrayinto aBooleanArrayisO(1). - Mutable
Dictionary Array - A mutable, strong-typed version of
DictionaryArray. - Mutable
Fixed Size Binary Array - The Arrow’s equivalent to a mutable
Vec<Option<[u8; size]>>. Converting aMutableFixedSizeBinaryArrayinto aFixedSizeBinaryArrayisO(1). - Mutable
Fixed Size List Array - The mutable version of
FixedSizeListArray. - Mutable
List Array - The mutable version of
ListArray. - Mutable
Null Array - A distinct type to disambiguate clashing methods
- Mutable
Primitive Array - The Arrow’s equivalent to
Vec<Option<T>>whereTis byte-size (e.g.i32). Converting aMutablePrimitiveArrayinto aPrimitiveArrayisO(1). - Mutable
Struct Array - Converting a
MutableStructArrayinto aStructArrayisO(1). - Mutable
Utf8 Array - A
MutableArraythat builds aUtf8Array. It differs fromMutableUtf8ValuesArrayin that it can build nullableUtf8Arrays. - Mutable
Utf8 Values Array - A
MutableArraythat builds aUtf8Array. It differs fromMutableUtf8Arrayin that it builds non-nullUtf8Array. - Null
Array - The concrete
ArrayofDataType::Null. - Primitive
Array - A
PrimitiveArrayis Arrow’s semantically equivalent of an immutableVec<Option<T>>where T isNativeType(e.g.i32). It implementsArray. - Struct
Array - A
StructArrayis a nestedArraywith an optional validity representing multipleArraywith the same number of rows. - Union
Array UnionArrayrepresents an array whose each slot can contain different values.- Utf8
Array - A
Utf8Arrayis arrow’s semantic equivalent of an immutableVec<Option<String>>. Cloning and slicing this struct isO(1).
Traits§
- Array
- A trait representing an immutable Arrow array. Arrow arrays are trait objects
that are infallibly downcasted to concrete types according to the
Array::data_type. - Arrow2
Arrow arrow - Trait providing bi-directional conversion between arrow2
Arrayand arrow-rsArrayData - Dictionary
Key - Trait denoting
NativeTypes that can be used as keys of a dictionary. - Generic
Binary Array - Trait that
BinaryArrayandUtf8Arrayimplement for the purposes of DRY. - Mutable
Array - A trait describing a mutable array; i.e. an array whose values can be changed.
Mutable arrays 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 asMutablePrimitiveArray) implement how they are mutated. - Push
Unchecked - A trait describing the ability of a struct to receive new items.
- TryExtend
- 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. - TryExtend
From Self - A trait describing the ability of a struct to extend from a reference of itself.
Specialization of
TryExtend. - TryPush
- A trait describing the ability of a struct to receive new items.
Functions§
- clone
- Clones a dynamic
Array. - equal
- Logically compares two
Arrays. Two arrays are logically equal if and only if: - from_
data arrow - Convert an
arrow_data::ArrayDatato arrow2Array - get_
display - Returns a function that writes the element of
arrayat positionindexto aWrite, writingnullto the null slots. - get_
value_ display - Returns a function that writes the value of the element of
arrayat positionindexto aWrite, writingnullin the null slots. - new_
empty_ array - Creates a new
Arraywith aArray::lenof 0. - new_
null_ array - Creates a new
ArrayofDataTypedata_typeandlength. The array is guaranteed to haveArray::null_countequal toArray::lenfor all types except Union, which does not have a validity. - to_data
arrow - Convert an arrow2
Arraytoarrow_data::ArrayData
Type Aliases§
- Binary
Value Iter - Iterator of values of an
BinaryArray. - Days
MsArray - A type definition
PrimitiveArrayfordays_ms - Days
MsVec - A type definition
MutablePrimitiveArrayfordays_ms - Float16
Array - A type definition
PrimitiveArrayforf16 - Float16
Vec - A type definition
MutablePrimitiveArrayforf16 - Float32
Array - A type definition
PrimitiveArrayforf32 - Float32
Vec - A type definition
MutablePrimitiveArrayforf32 - Float64
Array - A type definition
PrimitiveArrayforf64 - Float64
Vec - A type definition
MutablePrimitiveArrayforf64 - Int8
Array - A type definition
PrimitiveArrayfori8 - Int8Vec
- A type definition
MutablePrimitiveArrayfori8 - Int16
Array - A type definition
PrimitiveArrayfori16 - Int16
Vec - A type definition
MutablePrimitiveArrayfori16 - Int32
Array - A type definition
PrimitiveArrayfori32 - Int32
Vec - A type definition
MutablePrimitiveArrayfori32 - Int64
Array - A type definition
PrimitiveArrayfori64 - Int64
Vec - A type definition
MutablePrimitiveArrayfori64 - Int128
Array - A type definition
PrimitiveArrayfori128 - Int128
Vec - A type definition
MutablePrimitiveArrayfori128 - Int256
Array - A type definition
PrimitiveArrayfori256 - Int256
Vec - A type definition
MutablePrimitiveArrayfori256 - List
Values Iter - Iterator of values of a
ListArray. - Months
Days NsArray - A type definition
PrimitiveArrayformonths_days_ns - Months
Days NsVec - A type definition
MutablePrimitiveArrayformonths_days_ns - UInt8
Array - A type definition
PrimitiveArrayforu8 - UInt8
Vec - A type definition
MutablePrimitiveArrayforu8 - UInt16
Array - A type definition
PrimitiveArrayforu16 - UInt16
Vec - A type definition
MutablePrimitiveArrayforu16 - UInt32
Array - A type definition
PrimitiveArrayforu32 - UInt32
Vec - A type definition
MutablePrimitiveArrayforu32 - UInt64
Array - A type definition
PrimitiveArrayforu64 - UInt64
Vec - A type definition
MutablePrimitiveArrayforu64 - Utf8
Values Iter - Iterator of values of an
Utf8Array.