Skip to main content

ListViewArrayExt

Trait ListViewArrayExt 

Source
pub trait ListViewArrayExt: TypedArrayRef<ListView> {
    // Provided methods
    fn nullability(&self) -> Nullability { ... }
    fn elements(&self) -> &ArrayRef { ... }
    fn offsets(&self) -> &ArrayRef { ... }
    fn sizes(&self) -> &ArrayRef { ... }
    fn listview_validity(&self) -> Validity { ... }
    fn offset_at(&self, index: usize) -> usize { ... }
    fn size_at(&self, index: usize) -> usize { ... }
    fn list_elements_at(&self, index: usize) -> VortexResult<ArrayRef> { ... }
    fn verify_is_zero_copy_to_list(&self) -> bool { ... }
    fn compute_referenced_elements_mask(
        &self,
        ctx: &mut ExecutionCtx,
    ) -> VortexResult<Mask> { ... }
    fn compute_density(&self, ctx: &mut ExecutionCtx) -> VortexResult<f32> { ... }
    fn upper_bound_density(&self, ctx: &mut ExecutionCtx) -> VortexResult<f32> { ... }
}

Provided Methods§

Source

fn nullability(&self) -> Nullability

Source

fn elements(&self) -> &ArrayRef

Source

fn offsets(&self) -> &ArrayRef

Source

fn sizes(&self) -> &ArrayRef

Source

fn listview_validity(&self) -> Validity

Source

fn offset_at(&self, index: usize) -> usize

Source

fn size_at(&self, index: usize) -> usize

Source

fn list_elements_at(&self, index: usize) -> VortexResult<ArrayRef>

Source

fn verify_is_zero_copy_to_list(&self) -> bool

Source

fn compute_referenced_elements_mask( &self, ctx: &mut ExecutionCtx, ) -> VortexResult<Mask>

Returns a Mask of length elements.len() where each bit is set iff that position in elements is referenced by at least one view. Caller must ensure elements is non-empty.

Walks every (offset, size) pair, canonicalizes both offsets and sizes, and allocates a BitBuffer of length elements.len(), so it is extremely costly.

Preconditions

self.elements() must be non-empty.

Source

fn compute_density(&self, ctx: &mut ExecutionCtx) -> VortexResult<f32>

Exact fraction of elements referenced by some view, in [0.0, 1.0]. Extremely costly.

Returns Ok(1.0) when elements is empty instead of dividing by 0.

Source

fn upper_bound_density(&self, ctx: &mut ExecutionCtx) -> VortexResult<f32>

Upper-bound estimate of compute_density via sum(sizes) / elements.len(), clamped to [0.0, 1.0].

Exact for non-overlapping views, but overcounts when multiple views share the same elements.

Returns Ok(1.0) when elements is empty instead of dividing by 0.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§