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
impl Array
pub fn as_primitive(&self) -> PrimitiveArray
Source§impl Array
impl Array
pub fn tree_display(&self) -> TreeDisplayWrapper<'_>
Source§impl Array
impl Array
pub fn encoding(&self) -> EncodingRef
pub fn is_empty(&self) -> bool
Sourcepub fn nbytes(&self) -> usize
pub fn nbytes(&self) -> usize
Total size of the array in bytes, including all children and buffers.
pub fn child<'a>( &'a self, idx: usize, dtype: &'a DType, len: usize, ) -> VortexResult<Self>
Sourcepub fn children(&self) -> Vec<Array>
pub fn children(&self) -> Vec<Array>
Returns a Vec of Arrays with all of the array’s child arrays.
pub fn depth_first_traversal(&self) -> ArrayChildrenIterator ⓘ
Sourcepub fn cumulative_nbuffers(&self) -> usize
pub fn cumulative_nbuffers(&self) -> usize
Count the number of cumulative buffers encoded by self.
Sourcepub fn all_buffer_offsets(&self, alignment: usize) -> Vec<u64>
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.
Sourcepub fn metadata(&self) -> VortexResult<Cow<'_, [u8]>>
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.
pub fn buffer(&self) -> Option<&Buffer>
pub fn into_buffer(self) -> Option<Buffer>
pub fn into_array_iterator(self) -> impl ArrayIterator
pub fn into_array_stream(self) -> impl ArrayStream
Sourcepub fn is_encoding(&self, id: EncodingId) -> bool
pub fn is_encoding(&self, id: EncodingId) -> bool
Checks whether array is of a given encoding.
pub fn with_dyn<R, F>(&self, f: F) -> Rwhere
F: FnMut(&dyn ArrayTrait) -> R,
Trait Implementations§
Source§impl AsRef<Array> for ChunkedArray
impl AsRef<Array> for ChunkedArray
Source§impl AsRef<Array> for ConstantArray
impl AsRef<Array> for ConstantArray
Source§impl AsRef<Array> for ExtensionArray
impl AsRef<Array> for ExtensionArray
Source§impl AsRef<Array> for PrimitiveArray
impl AsRef<Array> for PrimitiveArray
Source§impl AsRef<Array> for SparseArray
impl AsRef<Array> for SparseArray
Source§impl AsRef<Array> for StructArray
impl AsRef<Array> for StructArray
Source§impl AsRef<Array> for VarBinArray
impl AsRef<Array> for VarBinArray
Source§impl AsRef<Array> for VarBinViewArray
impl AsRef<Array> for VarBinViewArray
Source§impl From<Canonical> for Array
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§impl From<ChunkedArray> for Array
impl From<ChunkedArray> for Array
Source§fn from(value: ChunkedArray) -> Array
fn from(value: ChunkedArray) -> Array
Source§impl From<ConstantArray> for Array
impl From<ConstantArray> for Array
Source§fn from(value: ConstantArray) -> Array
fn from(value: ConstantArray) -> Array
Source§impl From<ExtensionArray> for Array
impl From<ExtensionArray> for Array
Source§fn from(value: ExtensionArray) -> Array
fn from(value: ExtensionArray) -> Array
Source§impl From<NullBuffer> for Array
impl From<NullBuffer> for Array
Source§fn from(value: NullBuffer) -> Self
fn from(value: NullBuffer) -> Self
Source§impl<O> From<OffsetBuffer<O>> for Arraywhere
O: NativePType + OffsetSizeTrait,
impl<O> From<OffsetBuffer<O>> for Arraywhere
O: NativePType + OffsetSizeTrait,
Source§fn from(value: OffsetBuffer<O>) -> Self
fn from(value: OffsetBuffer<O>) -> Self
Source§impl From<PrimitiveArray> for Array
impl From<PrimitiveArray> for Array
Source§fn from(value: PrimitiveArray) -> Array
fn from(value: PrimitiveArray) -> Array
Source§impl<T> From<ScalarBuffer<T>> for Arraywhere
T: ArrowNativeType + NativePType,
impl<T> From<ScalarBuffer<T>> for Arraywhere
T: ArrowNativeType + NativePType,
Source§fn from(value: ScalarBuffer<T>) -> Self
fn from(value: ScalarBuffer<T>) -> Self
Source§impl From<SparseArray> for Array
impl From<SparseArray> for Array
Source§fn from(value: SparseArray) -> Array
fn from(value: SparseArray) -> Array
Source§impl From<StructArray> for Array
impl From<StructArray> for Array
Source§fn from(value: StructArray) -> Array
fn from(value: StructArray) -> Array
Source§impl From<TemporalArray> for Array
impl From<TemporalArray> for Array
Source§fn from(value: TemporalArray) -> Self
fn from(value: TemporalArray) -> Self
Source§impl From<VarBinArray> for Array
impl From<VarBinArray> for Array
Source§fn from(value: VarBinArray) -> Array
fn from(value: VarBinArray) -> Array
Source§impl From<VarBinViewArray> for Array
impl From<VarBinViewArray> for Array
Source§fn from(value: VarBinViewArray) -> Array
fn from(value: VarBinViewArray) -> Array
Source§impl FromArrowArray<&BooleanArray> for Array
impl FromArrowArray<&BooleanArray> for Array
fn from_arrow(value: &ArrowBooleanArray, nullable: bool) -> Self
Source§impl<T: ByteArrayType> FromArrowArray<&GenericByteArray<T>> for Array
impl<T: ByteArrayType> FromArrowArray<&GenericByteArray<T>> for Array
fn from_arrow(value: &GenericByteArray<T>, nullable: bool) -> Self
Source§impl<T: ByteViewType> FromArrowArray<&GenericByteViewArray<T>> for Array
impl<T: ByteViewType> FromArrowArray<&GenericByteViewArray<T>> for Array
fn from_arrow(value: &GenericByteViewArray<T>, nullable: bool) -> Self
Source§impl FromArrowArray<&NullArray> for Array
impl FromArrowArray<&NullArray> for Array
fn from_arrow(value: &ArrowNullArray, nullable: bool) -> Self
Source§impl<T: ArrowPrimitiveType> FromArrowArray<&PrimitiveArray<T>> for Array
impl<T: ArrowPrimitiveType> FromArrowArray<&PrimitiveArray<T>> for Array
fn from_arrow(value: &ArrowPrimitiveArray<T>, nullable: bool) -> Self
Source§impl FromArrowArray<&StructArray> for Array
impl FromArrowArray<&StructArray> for Array
fn from_arrow(value: &ArrowStructArray, nullable: bool) -> Self
Source§impl FromArrowArray<Arc<dyn Array>> for Array
impl FromArrowArray<Arc<dyn Array>> for Array
fn from_arrow(array: ArrowArrayRef, nullable: bool) -> Self
Source§impl FromIterator<Array> for ChunkedArray
impl FromIterator<Array> for ChunkedArray
Source§impl IntoCanonical for Array
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.
fn into_canonical(self) -> VortexResult<Canonical>
Source§impl ToArrayData for Array
impl ToArrayData for Array
fn to_array_data(&self) -> ArrayData
Source§impl TryFrom<&Array> for ChunkedArray
impl TryFrom<&Array> for ChunkedArray
Source§impl TryFrom<&Array> for ConstantArray
impl TryFrom<&Array> for ConstantArray
Source§impl TryFrom<&Array> for ExtensionArray
impl TryFrom<&Array> for ExtensionArray
Source§impl TryFrom<&Array> for PrimitiveArray
impl TryFrom<&Array> for PrimitiveArray
Source§impl TryFrom<&Array> for SparseArray
impl TryFrom<&Array> for SparseArray
Source§impl TryFrom<&Array> for StructArray
impl TryFrom<&Array> for StructArray
Source§impl TryFrom<&Array> for TemporalArray
impl TryFrom<&Array> for TemporalArray
Source§fn try_from(value: &Array) -> Result<Self, Self::Error>
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
type Error = VortexError
Source§impl TryFrom<&Array> for VarBinArray
impl TryFrom<&Array> for VarBinArray
Source§impl TryFrom<&Array> for VarBinViewArray
impl TryFrom<&Array> for VarBinViewArray
Source§impl TryFrom<Array> for ChunkedArray
impl TryFrom<Array> for ChunkedArray
Source§impl TryFrom<Array> for ConstantArray
impl TryFrom<Array> for ConstantArray
Source§impl TryFrom<Array> for ExtensionArray
impl TryFrom<Array> for ExtensionArray
Source§impl TryFrom<Array> for LogicalValidity
impl TryFrom<Array> for LogicalValidity
Source§type Error = VortexError
type Error = VortexError
Source§fn try_from(array: Array) -> VortexResult<Self>
fn try_from(array: Array) -> VortexResult<Self>
Source§impl TryFrom<Array> for PrimitiveArray
impl TryFrom<Array> for PrimitiveArray
Source§impl TryFrom<Array> for RecordBatch
impl TryFrom<Array> for RecordBatch
Source§type Error = VortexError
type Error = VortexError
Source§fn try_from(value: Array) -> VortexResult<Self>
fn try_from(value: Array) -> VortexResult<Self>
Source§impl TryFrom<Array> for SparseArray
impl TryFrom<Array> for SparseArray
Source§impl TryFrom<Array> for StructArray
impl TryFrom<Array> for StructArray
Source§impl TryFrom<Array> for TemporalArray
impl TryFrom<Array> for TemporalArray
Source§impl TryFrom<Array> for VarBinArray
impl TryFrom<Array> for VarBinArray
Source§impl TryFrom<Array> for VarBinViewArray
impl TryFrom<Array> for VarBinViewArray
Source§impl TryFrom<RecordBatch> for Array
impl TryFrom<RecordBatch> for Array
Source§type Error = VortexError
type Error = VortexError
Source§fn try_from(value: RecordBatch) -> VortexResult<Self>
fn try_from(value: RecordBatch) -> VortexResult<Self>
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> ArrayEncodingRef for T
impl<T> ArrayEncodingRef for T
fn encoding(&self) -> &'static dyn ArrayEncoding
Source§impl<T> ArrayStatistics for T
impl<T> ArrayStatistics for T
fn statistics(&self) -> &dyn Statistics
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> IntoArrayVariant for Twhere
T: IntoCanonical,
impl<T> IntoArrayVariant for Twhere
T: IntoCanonical,
fn into_null(self) -> Result<NullArray, VortexError>
fn into_bool(self) -> Result<BoolArray, VortexError>
fn into_primitive(self) -> Result<PrimitiveArray, VortexError>
fn into_struct(self) -> Result<StructArray, VortexError>
fn into_varbinview(self) -> Result<VarBinViewArray, VortexError>
fn into_extension(self) -> Result<ExtensionArray, VortexError>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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