pub trait FilterKernel: VTable {
// Required method
fn filter(
&self,
array: &Self::Array,
selection_mask: &Mask,
) -> VortexResult<ArrayRef>;
}
Required Methods§
Sourcefn filter(
&self,
array: &Self::Array,
selection_mask: &Mask,
) -> VortexResult<ArrayRef>
fn filter( &self, array: &Self::Array, selection_mask: &Mask, ) -> VortexResult<ArrayRef>
Filter an array by the provided predicate.
§Preconditions
The entrypoint filter functions will handle Mask::AllTrue
and Mask::AllFalse
on the
selection mask, leaving only Mask::Values
to be handled by this function.
Additionally, the array length is guaranteed to have the same length as the selection mask.
Finally, the array validity mask is guaranteed not to have a true count of 0 (all nulls).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl FilterKernel for BoolVTable
impl FilterKernel for ChunkedVTable
impl FilterKernel for ConstantVTable
impl FilterKernel for DecimalVTable
impl FilterKernel for ExtensionVTable
impl FilterKernel for FixedSizeListVTable
Filter implementation for FixedSizeListArray
.
Expands the selection mask to cover all elements within selected lists and pushes the expanded mask down to the child elements array.
impl FilterKernel for ListVTable
impl FilterKernel for ListViewVTable
ListViewArray
filter implementation.
This implementation is deliberately simple and read-optimized. We just filter the offsets
and
sizes
arrays and reuse the original elements
array. This works because ListView
(unlike
List
) allows non-contiguous and out-of-order lists.
We don’t slice the elements
array because it would require computing min/max offsets and
adjusting all offsets accordingly, which is not really worth the small potential memory we would
be able to get back.
The trade-off is that we may keep unreferenced elements in memory, but this is acceptable since we’re optimizing for read performance and the data isn’t being copied.