pub trait TakeReduce: VTable {
// Required method
fn take(
array: ArrayView<'_, Self>,
indices: &ArrayRef,
) -> VortexResult<Option<ArrayRef>>;
}Required Methods§
Sourcefn take(
array: ArrayView<'_, Self>,
indices: &ArrayRef,
) -> VortexResult<Option<ArrayRef>>
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§
impl TakeReduce for Constant
impl TakeReduce for Extension
impl TakeReduce for ListView
Metadata-only take for ListViewArray.
impl TakeReduce for Map
impl TakeReduce for Masked
impl TakeReduce for Null
impl TakeReduce for Struct
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.