Skip to main content

ZipKernel

Trait ZipKernel 

Source
pub trait ZipKernel: VTable {
    // Required method
    fn zip(
        array: ArrayView<'_, Self>,
        if_false: &ArrayRef,
        mask: &ArrayRef,
        ctx: &mut ExecutionCtx,
    ) -> VortexResult<Option<ArrayRef>>;
}
Expand description

Zip two arrays using a mask, potentially reading buffers.

Unlike ZipReduce, this trait is for zip implementations that may need to read and execute on the underlying buffers to produce the result.

Dispatch supports either value branch. The adaptor normalizes the inputs so array is selected where mask is true, and if_false everywhere else.

Required Methods§

Source

fn zip( array: ArrayView<'_, Self>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ZipKernel for Bool

A branchless boolean zip kernel that blends the two value bitmaps with the mask in one pass.

Booleans are bit-packed, so selecting if_true where the mask is set and if_false where it is not is a single bitwise blend over the packed words — (true & mask) | (false & !mask) — instead of the generic per-run builder. Validity is combined with the shared zip_validity, which itself reuses this kernel (terminating immediately, since validity bitmaps are non-nullable).

Source§

fn zip( if_true: ArrayView<'_, Bool>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for Chunked

Source§

fn zip( if_true: ArrayView<'_, Chunked>, if_false: &ArrayRef, mask: &ArrayRef, _ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for Decimal

A decimal zip kernel that selects values branchlessly per row.

The row selection is shared with Primitive through zip_fixed_width.

Source§

fn zip( if_true: ArrayView<'_, Decimal>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for FixedSizeList

Zips two fixed-size list arrays by zipping their elements with a mask that repeats each row’s bit list_size times.

Source§

fn zip( if_true: ArrayView<'_, FixedSizeList>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for ListView

Zip two ListViewArrays by selecting whole list views per row.

A ListViewArray addresses each list by an (offset, size) pair into a shared elements array, and unlike ListArray it does not require lists to be stored contiguously or in order. Zipping two list views is therefore a metadata-only operation over the offsets, sizes and validity child arrays: we concatenate the two elements arrays (without rewriting them) and, for each row, select the (offset, size) pair from if_true or if_false per the mask. if_false views are shifted past the end of if_true’s elements so they continue to address the correct half of the concatenated elements array.

Source§

fn zip( if_true: ArrayView<'_, ListView>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for Map

Zips the list-view entries of two maps and wraps the result in the map type.

Source§

fn zip( if_true: ArrayView<'_, Map>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for Primitive

A dedicated primitive zip kernel that selects values branchlessly per row.

The row selection is shared with Decimal through zip_fixed_width.

Source§

fn zip( if_true: ArrayView<'_, Primitive>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for Struct

Source§

fn zip( if_true: ArrayView<'_, Struct>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for VarBinView

Source§

fn zip( if_true: ArrayView<'_, VarBinView>, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Source§

impl ZipKernel for Widen

Zips the values of a Widen with another Widen or a constant at the type that holds both. The adaptor normalizes either branch to array and adjusts the mask accordingly.

Source§

fn zip( array: ArrayView<'_, Self>, if_false: &ArrayRef, mask: &ArrayRef, _ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Implementors§