Struct vortex_fastlanes::DeltaArray

source ·
pub struct DeltaArray(/* private fields */);

Implementations§

source§

impl DeltaArray

source

pub fn maybe_from(data: impl AsRef<ArrayData>) -> Option<Self>

Optionally downcast an ArrayData instance to a specific encoding.

Preferred in cases where a backtrace isn’t needed, like when trying multiple encoding to go down different code paths.

source§

impl DeltaArray

A FastLanes-style delta-encoded array of primitive values.

A DeltaArray comprises a sequence of chunks each representing 1,024 delta-encoded values, except the last chunk which may represent from one to 1,024 values.

§Examples

use vortex_fastlanes::DeltaArray;
let array = DeltaArray::try_from_vec(vec![1_u32, 2, 3, 5, 10, 11]).unwrap();

§Details

To facilitate slicing, this array accepts an offset and logical_len. The offset must be strictly less than 1,024 and the sum of offset and logical_len must not exceed the length of the deltas array. These values permit logical slicing without modifying any chunk containing a kept value. In particular, we may defer decompresison until the array is canonicalized or indexed. The offset is a physical offset into the first chunk, which necessarily contains 1,024 values. The logical_len is the number of logical values following the offset, which may be less than the number of physically stored values.

Each chunk is stored as a vector of bases and a vector of deltas. If the chunk physically contains 1,024 vlaues, then there are as many bases as there are lanes of this type in a 1024-bit register. For example, for 64-bit values, there are 16 bases because there are 16 lanes. Each lane is a delta-encoding 1024 / bit_width long vector of values. The deltas are stored in the FastLanes order which splits the 1,024 values into one contiguous sub-sequence per-lane, thus permitting delta encoding.

If the chunk physically has fewer than 1,024 values, then it is stored as a traditional, non-SIMD-amenable, delta-encoded vector.

source

pub fn try_from_vec<T: NativePType>(vec: Vec<T>) -> VortexResult<Self>

source

pub fn try_from_primitive_array(array: &PrimitiveArray) -> VortexResult<Self>

source

pub fn try_from_delta_compress_parts( bases: ArrayData, deltas: ArrayData, validity: Validity, ) -> VortexResult<Self>

source

pub fn try_new( bases: ArrayData, deltas: ArrayData, validity: Validity, offset: usize, logical_len: usize, ) -> VortexResult<Self>

source

pub fn bases(&self) -> ArrayData

source

pub fn deltas(&self) -> ArrayData

source

pub fn offset(&self) -> usize

The logical offset into the first chunk of Self::deltas.

source

pub fn validity(&self) -> Validity

Trait Implementations§

source§

impl AsRef<ArrayData> for DeltaArray

source§

fn as_ref(&self) -> &ArrayData

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

impl Clone for DeltaArray

source§

fn clone(&self) -> DeltaArray

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 DeltaArray

source§

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

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

impl IntoArrayData for DeltaArray

source§

fn into_array(self) -> ArrayData

source§

impl IntoCanonical for DeltaArray

source§

fn into_canonical(self) -> VortexResult<Canonical>

§

fn into_arrow(self) -> Result<Arc<dyn Array>, VortexError>
where Self: Sized,

source§

impl PrimitiveArrayTrait for DeltaArray

§

fn ptype(&self) -> PType

The logical primitive type of the array. Read more
source§

impl ScalarAtFn<DeltaArray> for DeltaEncoding

source§

fn scalar_at(&self, array: &DeltaArray, index: usize) -> VortexResult<Scalar>

source§

impl SliceFn<DeltaArray> for DeltaEncoding

source§

fn slice( &self, array: &DeltaArray, start: usize, stop: usize, ) -> VortexResult<ArrayData>

Return a zero-copy slice of an array, between start (inclusive) and end (exclusive). If start >= stop, returns an empty array of the same type as self. Assumes that start or stop are out of bounds, may panic otherwise.
source§

impl StatisticsVTable<DeltaArray> for DeltaEncoding

§

fn compute_statistics( &self, _array: &Array, _stat: Stat, ) -> Result<StatsSet, VortexError>

Compute the requested statistic. Can return additional stats.
source§

impl<'a> TryFrom<&'a ArrayData> for &'a DeltaArray

source§

type Error = VortexError

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

fn try_from(data: &'a ArrayData) -> VortexResult<Self>

Performs the conversion.
source§

impl TryFrom<ArrayData> for DeltaArray

source§

type Error = VortexError

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

fn try_from(data: ArrayData) -> VortexResult<Self>

Performs the conversion.
source§

impl ValidityVTable<DeltaArray> for DeltaEncoding

source§

fn is_valid(&self, array: &DeltaArray, index: usize) -> bool

source§

fn logical_validity(&self, array: &DeltaArray) -> LogicalValidity

source§

impl VariantsVTable<DeltaArray> for DeltaEncoding

source§

fn as_primitive_array<'a>( &self, array: &'a DeltaArray, ) -> Option<&'a dyn PrimitiveArrayTrait>

§

fn as_null_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn NullArrayTrait>

§

fn as_bool_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn BoolArrayTrait>

§

fn as_utf8_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn Utf8ArrayTrait>

§

fn as_binary_array<'a>( &self, _array: &'a Array, ) -> Option<&'a dyn BinaryArrayTrait>

§

fn as_struct_array<'a>( &self, _array: &'a Array, ) -> Option<&'a dyn StructArrayTrait>

§

fn as_list_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn ListArrayTrait>

§

fn as_extension_array<'a>( &self, _array: &'a Array, ) -> Option<&'a dyn ExtensionArrayTrait>

source§

impl VisitorVTable<DeltaArray> for DeltaEncoding

source§

fn accept( &self, array: &DeltaArray, visitor: &mut dyn ArrayVisitor, ) -> VortexResult<()>

source§

impl ArrayTrait for DeltaArray

Auto Trait Implementations§

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
§

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

§

fn dtype(&self) -> &DType

§

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

§

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

§

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

§

fn len(&self) -> usize

§

fn is_empty(&self) -> bool

§

impl<A> ArrayNBytes for A
where A: AsRef<ArrayData>,

§

fn nbytes(&self) -> usize

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

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

§

fn statistics(&self) -> &dyn Statistics

§

fn inherit_statistics(&self, parent: &dyn Statistics)

§

impl<A> ArrayValidity for A
where A: AsRef<ArrayData>,

§

fn is_valid(&self, index: usize) -> bool

Return whether the element at the given index is valid (true) or null (false).

§

fn logical_validity(&self) -> LogicalValidity

Return the logical validity of the array.

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoArrayVariant for T
where 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_list(self) -> Result<ListArray, VortexError>

§

fn into_varbinview(self) -> Result<VarBinViewArray, VortexError>

§

fn into_extension(self) -> Result<ExtensionArray, VortexError>

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<T> Same for T

source§

type Output = T

Should always be Self
§

impl<A> ToArrayData for A
where A: AsRef<ArrayData>,

§

fn to_array(&self) -> ArrayData

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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

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

§

impl<T> MaybeSendSync for T

§

impl<T> Ungil for T
where T: Send,