pub struct FilterMask { /* private fields */ }
Expand description
Represents the mask argument to a filter function. Internally this will cache the canonical representation of the mask if it is ever used.
Implementations§
Source§impl FilterMask
impl FilterMask
Sourcepub fn from_indices<V: AsPrimitive<usize>, I: IntoIterator<Item = V>>(
length: usize,
indices: I,
) -> Self
pub fn from_indices<V: AsPrimitive<usize>, I: IntoIterator<Item = V>>( length: usize, indices: I, ) -> Self
Create a new FilterMask where the given indices are set.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn true_count(&self) -> usize
pub fn true_count(&self) -> usize
Get the true count of the mask.
Sourcepub fn false_count(&self) -> usize
pub fn false_count(&self) -> usize
Get the false count of the mask.
Sourcepub fn selectivity(&self) -> f64
pub fn selectivity(&self) -> f64
Return the selectivity of the full mask.
Sourcepub fn range_selectivity(&self) -> f64
pub fn range_selectivity(&self) -> f64
Return the selectivity of the range of true values of the mask.
Sourcepub fn to_boolean_buffer(&self) -> VortexResult<BooleanBuffer>
pub fn to_boolean_buffer(&self) -> VortexResult<BooleanBuffer>
Get the canonical representation of the mask.
Sourcepub fn iter(&self) -> VortexResult<FilterIter<'_>>
pub fn iter(&self) -> VortexResult<FilterIter<'_>>
Returns the best iterator based on a selectivity threshold.
Currently, this threshold is fixed at 0.8 based on Arrow Rust.
pub fn iter_slices( &self, ) -> VortexResult<impl Iterator<Item = (usize, usize)> + '_>
pub fn iter_indices(&self) -> VortexResult<impl Iterator<Item = usize> + '_>
Trait Implementations§
Source§impl Clone for FilterMask
We implement Clone manually to trigger population of our cached indices or slices.
By making the filter API take FilterMask by value, whenever it gets used multiple times
in a recursive function, we will cache the slices internally.
impl Clone for FilterMask
We implement Clone manually to trigger population of our cached indices or slices. By making the filter API take FilterMask by value, whenever it gets used multiple times in a recursive function, we will cache the slices internally.
Source§impl Debug for FilterMask
impl Debug for FilterMask
Source§impl From<BooleanBuffer> for FilterMask
impl From<BooleanBuffer> for FilterMask
Source§fn from(value: BooleanBuffer) -> Self
fn from(value: BooleanBuffer) -> Self
Source§impl FromIterator<bool> for FilterMask
impl FromIterator<bool> for FilterMask
Auto Trait Implementations§
impl !Freeze for FilterMask
impl !RefUnwindSafe for FilterMask
impl Send for FilterMask
impl Sync for FilterMask
impl Unpin for FilterMask
impl !UnwindSafe for FilterMask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more