Skip to main content

TakeReduce

Trait TakeReduce 

Source
pub trait TakeReduce: VTable {
    // Required method
    fn take(
        array: ArrayView<'_, Self>,
        indices: &ArrayRef,
    ) -> VortexResult<Option<ArrayRef>>;
}

Required Methods§

Source

fn take( array: ArrayView<'_, Self>, indices: &ArrayRef, ) -> VortexResult<Option<ArrayRef>>

Take elements from an array at the given indices without reading buffers.

This trait is for take implementations that can operate purely on array metadata and structure without needing to read or execute on the underlying buffers. Implementations should return None if taking requires buffer access.

§Preconditions

The indices are guaranteed to be non-empty.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl TakeReduce for Constant

Source§

impl TakeReduce for Extension

Source§

impl TakeReduce for ListView

Metadata-only take for ListViewArray.

Source§

impl TakeReduce for Map

Source§

impl TakeReduce for Masked

Source§

impl TakeReduce for Null

Source§

impl TakeReduce for Struct

Source§

impl TakeReduce for Union

Gathers the type IDs and every sparse child at indices.

Sparse children are row-aligned with the union, so a gather must visit all of them. Take costs O(variants * indices), which only the dense encoding fixes.

The type IDs carry the union’s validity, so gathering them with the original indices turns a null index into an outer union null. The children are gathered with the nulls filled in, which keeps their declared variant dtypes.

Source§

impl TakeReduce for Variant