Skip to main content

ListViewArrayExt

Trait ListViewArrayExt 

Source
pub trait ListViewArrayExt: TypedArrayRef<ListView> {
Show 13 methods // 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> { ... } fn referenced_element_bounds( &self, ctx: &mut ExecutionCtx, ) -> VortexResult<(usize, usize)> { ... }
}

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.

Source

fn referenced_element_bounds( &self, ctx: &mut ExecutionCtx, ) -> VortexResult<(usize, usize)>

Returns the half-open range [start, end) of elements indices referenced by any view: the minimum offset and the maximum offset + size. Elements outside this range are unreferenced leading or trailing slack that a TrimElements rebuild would reclaim.

For zero-copy-to-list arrays this is O(1): views are sorted and non-overlapping with no interior gaps, so the bounds are exactly [first_offset, last_offset + last_size). Otherwise it computes min/max statistics over offsets and offsets + sizes.

§Preconditions

The array must contain at least one list (len() > 0).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§