polars_arrow

Module array

Source
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 laid in memory according to the Arrow specification. Each array type has its own struct. The following are the main array types:

All immutable arrays implement the trait object Array and that can be downcast to a concrete struct based on PhysicalType available from Array::dtype. All immutable arrays are backed by Buffer and thus cloning and slicing them is O(1).

Most arrays contain a MutableArray counterpart that is neither cloneable nor sliceable, but can be operated in-place.

Re-exports§

pub use iterator::ArrayValuesIter;

Modules§

growable
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 Arrays.
iterator
physical_binary
specification

Structs§

BinaryArray
A BinaryArray is Arrow’s semantically equivalent of an immutable Vec<Option<Vec<u8>>>. It implements Array.
BinaryViewArrayGeneric
BooleanArray
A BooleanArray is Arrow’s semantically equivalent of an immutable Vec<Option<bool>>. It implements Array.
DictionaryArray
An Array whose values are stored as indices. This Array is useful when the cardinality of values is low compared to the length of the Array.
FixedSizeBinaryArray
The Arrow’s equivalent to an immutable Vec<Option<[u8; size]>>. Cloning and slicing this struct is O(1).
FixedSizeListArray
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).
ListArray
An Array semantically equivalent to Vec<Option<Vec<Option<T>>>> with Arrow’s in-memory.
MapArray
An array representing a (key, value), both of arbitrary logical types.
MutableBinaryArray
The Arrow’s equivalent to Vec<Option<Vec<u8>>>. Converting a MutableBinaryArray into a BinaryArray is O(1).
MutableBinaryValuesArray
A MutableArray that builds a BinaryArray. It differs from MutableBinaryArray in that it builds non-null BinaryArray.
MutableBinaryViewArray
MutableBooleanArray
The Arrow’s equivalent to Vec<Option<bool>>, but with 1/16 of its size. Converting a MutableBooleanArray into a BooleanArray is O(1).
MutableDictionaryArray
MutableFixedSizeBinaryArray
The Arrow’s equivalent to a mutable Vec<Option<[u8; size]>>. Converting a MutableFixedSizeBinaryArray into a FixedSizeBinaryArray is O(1).
MutableFixedSizeListArray
The mutable version of FixedSizeListArray.
MutableListArray
The mutable version of ListArray.
MutableNullArray
A distinct type to disambiguate clashing methods
MutablePrimitiveArray
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).
MutableUtf8Array
A MutableArray that builds a Utf8Array. It differs from MutableUtf8ValuesArray in that it can build nullable Utf8Arrays.
MutableUtf8ValuesArray
A MutableArray that builds a Utf8Array. It differs from MutableUtf8Array in that it builds non-null Utf8Array.
NullArray
The concrete Array of ArrowDataType::Null.
PrimitiveArray
A PrimitiveArray is Arrow’s semantically equivalent of an immutable Vec<Option<T>> where T is NativeType (e.g. i32). It implements Array.
StructArray
A StructArray is a nested Array with an optional validity representing multiple Array with the same number of rows.
UnionArray
UnionArray represents an array whose each slot can contain different values.
Utf8Array
A Utf8Array is arrow’s semantic equivalent of an immutable Vec<Option<String>>. Cloning and slicing this struct is O(1).
View
A reference to a set of bytes.

Traits§

Array
A trait representing an immutable Arrow array. Arrow arrays are trait objects that are infallibly downcast to concrete types according to the Array::dtype.
ArrayCollectIterExt
ArrayFromIter
ArrayFromIterDtype
DictionaryKey
Trait denoting NativeTypes that can be used as keys of a dictionary.
GenericBinaryArray
Trait that BinaryArray and Utf8Array implement for the purposes of DRY.
MutableArray
A trait describing a mutable array; i.e. an array whose values can be changed.
ParameterFreeDtypeStaticArray
PushUnchecked
A trait describing the ability of a struct to receive new items.
Splitable
StaticArray
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.
TryExtendFromSelf
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.
ValueSize
ViewType

Functions§

clone
Clones a dynamic Array.
equal
Logically compares two Arrays. Two arrays are logically equal if and only if:
get_display
Returns a function that writes the element of array at position index to a Write, writing null to the null slots.
get_value_display
Returns a function that writes the value of the element of array at position index to a Write, writing null in the null slots.
new_empty_array
Creates a new Array with a Array::len of 0.
new_null_array
Creates a new Array of ArrowDataType dtype and length.
validate_utf8_view

Type Aliases§

ArrayRef
BinaryValueIter
Iterator of values of an BinaryArray.
BinaryViewArray
DaysMsArray
A type definition PrimitiveArray for days_ms
DaysMsVec
A type definition MutablePrimitiveArray for days_ms
Float16Array
A type definition PrimitiveArray for f16
Float16Vec
A type definition MutablePrimitiveArray for f16
Float32Array
A type definition PrimitiveArray for f32
Float32Vec
A type definition MutablePrimitiveArray for f32
Float64Array
A type definition PrimitiveArray for f64
Float64Vec
A type definition MutablePrimitiveArray for f64
Int8Array
A type definition PrimitiveArray for i8
Int8Vec
A type definition MutablePrimitiveArray for i8
Int16Array
A type definition PrimitiveArray for i16
Int16Vec
A type definition MutablePrimitiveArray for i16
Int32Array
A type definition PrimitiveArray for i32
Int32Vec
A type definition MutablePrimitiveArray for i32
Int64Array
A type definition PrimitiveArray for i64
Int64Vec
A type definition MutablePrimitiveArray for i64
Int128Array
A type definition PrimitiveArray for i128
Int128Vec
A type definition MutablePrimitiveArray for i128
Int256Array
A type definition PrimitiveArray for i256
Int256Vec
A type definition MutablePrimitiveArray for i256
ListValuesIter
Iterator of values of a ListArray.
MonthsDaysNsArray
A type definition PrimitiveArray for months_days_ns
MonthsDaysNsVec
A type definition MutablePrimitiveArray for months_days_ns
MutablePlBinary
MutablePlString
UInt8Array
A type definition PrimitiveArray for u8
UInt8Vec
A type definition MutablePrimitiveArray for u8
UInt16Array
A type definition PrimitiveArray for u16
UInt16Vec
A type definition MutablePrimitiveArray for u16
UInt32Array
A type definition PrimitiveArray for u32
UInt32Vec
A type definition MutablePrimitiveArray for u32
UInt64Array
A type definition PrimitiveArray for u64
UInt64Vec
A type definition MutablePrimitiveArray for u64
Utf8ValuesIter
Iterator of values of an Utf8Array.
Utf8ViewArray