pub struct FilterMask(/* private fields */);
Expand description
Represents the mask argument to a filter function.
A FilterMask
can be constructed from various representations, and converted to various
others. Internally, these are cached.
Implementations§
Source§impl FilterMask
impl FilterMask
Sourcepub fn from_buffer(buffer: BooleanBuffer) -> Self
pub fn from_buffer(buffer: BooleanBuffer) -> Self
Create a new FilterMask
from a BooleanBuffer
.
Sourcepub fn from_indices(len: usize, vec: Vec<usize>) -> Self
pub fn from_indices(len: usize, vec: Vec<usize>) -> Self
Create a new FilterMask
from a Vec<usize>
.
Sourcepub fn from_slices(len: usize, vec: Vec<(usize, usize)>) -> Self
pub fn from_slices(len: usize, vec: Vec<(usize, usize)>) -> Self
Create a new FilterMask
from a [Vec<(usize, usize)>
] where each range
represents a contiguous range of true values.
Sourcepub fn from_intersection_indices(
len: usize,
lhs: impl Iterator<Item = usize>,
rhs: impl Iterator<Item = usize>,
) -> Self
pub fn from_intersection_indices( len: usize, lhs: impl Iterator<Item = usize>, rhs: impl Iterator<Item = usize>, ) -> Self
Create a new FilterMask
from the intersection of two indices slices.
pub fn len(&self) -> usize
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 boolean_buffer(&self) -> &BooleanBuffer
pub fn boolean_buffer(&self) -> &BooleanBuffer
Get the canonical representation of the mask.
Sourcepub fn iter(&self) -> FilterIter<'_>
pub fn iter(&self) -> FilterIter<'_>
Returns the best iterator based on a selectivity threshold.
Currently, this threshold is fixed at 0.8 based on Arrow Rust.
Sourcepub fn intersect_by_rank(&self, mask: &FilterMask) -> FilterMask
pub fn intersect_by_rank(&self, mask: &FilterMask) -> FilterMask
take the intersection of the mask
with the set of true values in self
.
We are more interested in low selectivity self
(as indices) with a boolean buffer mask,
so we don’t optimize for other cases, yet.
Trait Implementations§
Source§impl BitAnd for &FilterMask
impl BitAnd for &FilterMask
Source§impl Clone for FilterMask
impl Clone for FilterMask
Source§fn clone(&self) -> FilterMask
fn clone(&self) -> FilterMask
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§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
Source§impl PartialEq for FilterMask
impl PartialEq for FilterMask
Source§impl TryFrom<ArrayData> for FilterMask
impl TryFrom<ArrayData> for FilterMask
impl Eq 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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