Skip to main content

ListArrayExt

Trait ListArrayExt 

Source
pub trait ListArrayExt {
    type Offset: OffsetSizeTrait;

    // Required methods
    fn filter_garbage_nulls(&self) -> Self;
    fn trimmed_values(&self) -> Arc<dyn Array>;
    fn trimmed_offsets(&self) -> OffsetBuffer<Self::Offset>;
}

Required Associated Types§

Source

type Offset: OffsetSizeTrait

The offset type of the underlying list array.

Required Methods§

Source

fn filter_garbage_nulls(&self) -> Self

Filters out masked null items from the list array

It is legal for a list array to have a null entry with a non-zero length. The values inside the entry are “garbage” and should be ignored. This function filters the values array to remove the garbage values.

The output list will always have zero-length nulls.

Source

fn trimmed_values(&self) -> Arc<dyn Array>

Returns a copy of the list’s values array that has been sliced to size

It is legal for a list array’s offsets to not start with zero. It’s also legal for a list array’s offsets to not extend to the entire values array. This function behaves similarly to values() except it slices the array so that it starts at the first list offset and ends at the last list offset.

Source

fn trimmed_offsets(&self) -> OffsetBuffer<Self::Offset>

Returns offsets shifted so the first offset is zero, matching Self::trimmed_values.

Sliced list arrays (e.g. a filtered batch) keep offsets that reference the original values buffer, so combining them with trimmed values produces offsets that exceed the values length. Use this together with trimmed_values when constructing a new list array.

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<OffsetSize: OffsetSizeTrait> ListArrayExt for GenericListArray<OffsetSize>

Source§

type Offset = OffsetSize

Source§

fn filter_garbage_nulls(&self) -> Self

Source§

fn trimmed_values(&self) -> Arc<dyn Array>

Source§

fn trimmed_offsets(&self) -> OffsetBuffer<OffsetSize>

Implementors§