vortex_array

Struct Array

Source
pub struct Array(/* private fields */);
Expand description

A central type for all Vortex arrays, which are known length sequences of typed and possibly compressed data.

This is the main entrypoint for working with in-memory Vortex data, and dispatches work over the underlying encoding or memory representations.

Implementations§

Source§

impl Array

Source§

impl Array

Source

pub fn tree_display(&self) -> TreeDisplayWrapper<'_>

Source§

impl Array

Source

pub fn encoding(&self) -> EncodingRef

Source

pub fn len(&self) -> usize

Returns the number of logical elements in the array.

Source

pub fn is_empty(&self) -> bool

Source

pub fn nbytes(&self) -> usize

Total size of the array in bytes, including all children and buffers.

Source

pub fn child<'a>( &'a self, idx: usize, dtype: &'a DType, len: usize, ) -> VortexResult<Self>

Source

pub fn children(&self) -> Vec<Array>

Returns a Vec of Arrays with all of the array’s child arrays.

Source

pub fn nchildren(&self) -> usize

Returns the number of child arrays

Source

pub fn depth_first_traversal(&self) -> ArrayChildrenIterator

Source

pub fn cumulative_nbuffers(&self) -> usize

Count the number of cumulative buffers encoded by self.

Source

pub fn all_buffer_offsets(&self, alignment: usize) -> Vec<u64>

Return the buffer offsets and the total length of all buffers, assuming the given alignment. This includes all child buffers.

Source

pub fn metadata(&self) -> VortexResult<Cow<'_, [u8]>>

Get back the (possibly owned) metadata for the array.

View arrays will return a reference to their bytes, while heap-backed arrays must first serialize their metadata, returning an owned byte array to the caller.

Source

pub fn buffer(&self) -> Option<&Buffer>

Source

pub fn into_buffer(self) -> Option<Buffer>

Source

pub fn into_array_iterator(self) -> impl ArrayIterator

Source

pub fn into_array_stream(self) -> impl ArrayStream

Source

pub fn is_encoding(&self, id: EncodingId) -> bool

Checks whether array is of a given encoding.

Source

pub fn with_dyn<R, F>(&self, f: F) -> R
where F: FnMut(&dyn ArrayTrait) -> R,

Trait Implementations§

Source§

impl AsRef<Array> for Array

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for BoolArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for ChunkedArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for ConstantArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for ExtensionArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for NullArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for PrimitiveArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for SparseArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for StructArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for VarBinArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Array> for VarBinViewArray

Source§

fn as_ref(&self) -> &Array

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Array

Source§

fn clone(&self) -> Array

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Array

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Array

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Array> for ArrayData

Source§

fn from(value: Array) -> ArrayData

Converts to this type from the input type.
Source§

impl From<ArrayData> for Array

Source§

fn from(value: ArrayData) -> Array

Converts to this type from the input type.
Source§

impl From<BoolArray> for Array

Source§

fn from(value: BoolArray) -> Array

Converts to this type from the input type.
Source§

impl From<Buffer> for Array

Source§

fn from(value: Buffer) -> Self

Converts to this type from the input type.
Source§

impl From<Canonical> for Array

This conversion is always “free” and should not touch underlying data. All it does is create an owned pointer to the underlying concrete array type.

This combined with the above IntoCanonical impl for Array allows simple two-way conversions between arbitrary Vortex encodings and canonical Arrow-compatible encodings.

Source§

fn from(value: Canonical) -> Self

Converts to this type from the input type.
Source§

impl From<ChunkedArray> for Array

Source§

fn from(value: ChunkedArray) -> Array

Converts to this type from the input type.
Source§

impl From<ConstantArray> for Array

Source§

fn from(value: ConstantArray) -> Array

Converts to this type from the input type.
Source§

impl From<ExtensionArray> for Array

Source§

fn from(value: ExtensionArray) -> Array

Converts to this type from the input type.
Source§

impl From<NullArray> for Array

Source§

fn from(value: NullArray) -> Array

Converts to this type from the input type.
Source§

impl From<NullBuffer> for Array

Source§

fn from(value: NullBuffer) -> Self

Converts to this type from the input type.
Source§

impl<O> From<OffsetBuffer<O>> for Array

Source§

fn from(value: OffsetBuffer<O>) -> Self

Converts to this type from the input type.
Source§

impl From<PrimitiveArray> for Array

Source§

fn from(value: PrimitiveArray) -> Array

Converts to this type from the input type.
Source§

impl<T> From<ScalarBuffer<T>> for Array

Source§

fn from(value: ScalarBuffer<T>) -> Self

Converts to this type from the input type.
Source§

impl From<SparseArray> for Array

Source§

fn from(value: SparseArray) -> Array

Converts to this type from the input type.
Source§

impl From<StructArray> for Array

Source§

fn from(value: StructArray) -> Array

Converts to this type from the input type.
Source§

impl From<TemporalArray> for Array

Source§

fn from(value: TemporalArray) -> Self

Converts to this type from the input type.
Source§

impl From<VarBinArray> for Array

Source§

fn from(value: VarBinArray) -> Array

Converts to this type from the input type.
Source§

impl From<VarBinViewArray> for Array

Source§

fn from(value: VarBinViewArray) -> Array

Converts to this type from the input type.
Source§

impl From<Vec<Option<Buffer>>> for Array

Source§

fn from(value: Vec<Option<Buffer>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<BufferString>>> for Array

Source§

fn from(value: Vec<Option<BufferString>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<bool>>> for Array

Source§

fn from(value: Vec<Option<bool>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<f16>>> for Array

Source§

fn from(value: Vec<Option<f16>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<f32>>> for Array

Source§

fn from(value: Vec<Option<f32>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<f64>>> for Array

Source§

fn from(value: Vec<Option<f64>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<i16>>> for Array

Source§

fn from(value: Vec<Option<i16>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<i32>>> for Array

Source§

fn from(value: Vec<Option<i32>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<i64>>> for Array

Source§

fn from(value: Vec<Option<i64>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<i8>>> for Array

Source§

fn from(value: Vec<Option<i8>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<u16>>> for Array

Source§

fn from(value: Vec<Option<u16>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<u32>>> for Array

Source§

fn from(value: Vec<Option<u32>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<u64>>> for Array

Source§

fn from(value: Vec<Option<u64>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<u8>>> for Array

Source§

fn from(value: Vec<Option<u8>>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<f16>> for Array

Source§

fn from(value: Vec<f16>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<f32>> for Array

Source§

fn from(value: Vec<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<f64>> for Array

Source§

fn from(value: Vec<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i16>> for Array

Source§

fn from(value: Vec<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i32>> for Array

Source§

fn from(value: Vec<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i64>> for Array

Source§

fn from(value: Vec<i64>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i8>> for Array

Source§

fn from(value: Vec<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u16>> for Array

Source§

fn from(value: Vec<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u32>> for Array

Source§

fn from(value: Vec<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u64>> for Array

Source§

fn from(value: Vec<u64>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for Array

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
Source§

impl FromArrowArray<&BooleanArray> for Array

Source§

fn from_arrow(value: &ArrowBooleanArray, nullable: bool) -> Self

Source§

impl<T: ByteArrayType> FromArrowArray<&GenericByteArray<T>> for Array

Source§

fn from_arrow(value: &GenericByteArray<T>, nullable: bool) -> Self

Source§

impl<T: ByteViewType> FromArrowArray<&GenericByteViewArray<T>> for Array

Source§

fn from_arrow(value: &GenericByteViewArray<T>, nullable: bool) -> Self

Source§

impl FromArrowArray<&NullArray> for Array

Source§

fn from_arrow(value: &ArrowNullArray, nullable: bool) -> Self

Source§

impl<T: ArrowPrimitiveType> FromArrowArray<&PrimitiveArray<T>> for Array

Source§

fn from_arrow(value: &ArrowPrimitiveArray<T>, nullable: bool) -> Self

Source§

impl FromArrowArray<&StructArray> for Array

Source§

fn from_arrow(value: &ArrowStructArray, nullable: bool) -> Self

Source§

impl FromArrowArray<Arc<dyn Array>> for Array

Source§

fn from_arrow(array: ArrowArrayRef, nullable: bool) -> Self

Source§

impl FromIterator<Array> for ChunkedArray

Source§

fn from_iter<T: IntoIterator<Item = Array>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl IndexOrd<Scalar> for Array

Source§

fn index_cmp(&self, idx: usize, elem: &Scalar) -> Option<Ordering>

Source§

fn index_lt(&self, idx: usize, elem: &V) -> bool

Source§

fn index_le(&self, idx: usize, elem: &V) -> bool

Source§

fn index_gt(&self, idx: usize, elem: &V) -> bool

Source§

fn index_ge(&self, idx: usize, elem: &V) -> bool

Source§

impl IntoCanonical for Array

IntoCanonical implementation for Array.

Canonicalizing an array requires potentially decompressing, so this requires a roundtrip through the array’s internal codec.

Source§

impl Len for Array

Source§

fn len(&self) -> usize

Source§

impl ToArrayData for Array

Source§

impl TryFrom<&Array> for BoolArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for ChunkedArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for ConstantArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for ExtensionArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for NullArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for PrimitiveArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for SparseArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for StructArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for TemporalArray

Source§

fn try_from(value: &Array) -> Result<Self, Self::Error>

Try to specialize a generic Vortex array as a TemporalArray.

§Errors

If the provided Array does not have vortex.ext encoding, an error will be returned.

If the provided Array does not have recognized ExtMetadata corresponding to one of the known TemporalMetadata variants, an error is returned.

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

impl<'a, D: ArrayDef> TryFrom<&'a Array> for TypedArray<D>

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for VarBinArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Array> for VarBinViewArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: &Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for BoolArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for ChunkedArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for ConstantArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for ExtensionArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for LogicalValidity

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> VortexResult<Self>

Performs the conversion.
Source§

impl TryFrom<Array> for NullArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for PrimitiveArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for RecordBatch

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Array) -> VortexResult<Self>

Performs the conversion.
Source§

impl TryFrom<Array> for SparseArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for StructArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for TemporalArray

Source§

fn try_from(value: Array) -> Result<Self, Self::Error>

Try to specialize a generic Vortex array as a TemporalArray.

Delegates to TryFrom<&Array>.

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

impl<D: ArrayDef> TryFrom<Array> for TypedArray<D>

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for Validity

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for VarBinArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Array> for VarBinViewArray

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: Array) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<RecordBatch> for Array

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(value: RecordBatch) -> VortexResult<Self>

Performs the conversion.

Auto Trait Implementations§

§

impl !Freeze for Array

§

impl !RefUnwindSafe for Array

§

impl Send for Array

§

impl Sync for Array

§

impl Unpin for Array

§

impl !UnwindSafe for Array

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArrayDType for T
where T: AsRef<Array>,

Source§

fn dtype(&self) -> &DType

Source§

impl<T> ArrayEncodingRef for T
where T: AsRef<Array>,

Source§

fn encoding(&self) -> &'static dyn ArrayEncoding

Source§

impl<T> ArrayLen for T
where T: AsRef<Array>,

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

impl<T> ArrayStatistics for T
where T: AsRef<Array>,

Source§

fn statistics(&self) -> &dyn Statistics

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoArrayVariant for T
where T: IntoCanonical,

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<S, T> SearchSorted<T> for S
where S: IndexOrd<T> + Len + ?Sized,

Source§

fn search_sorted_by<F, N>( &self, find: F, side_find: N, side: SearchSortedSide, ) -> SearchResult
where F: FnMut(usize) -> Ordering, N: FnMut(usize) -> Ordering,

find function is used to find the element if it exists, if element exists side_find will be used to find desired index amongst equal values
Source§

fn search_sorted(&self, value: &T, side: SearchSortedSide) -> SearchResult
where Self: IndexOrd<T>,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T