vortex_array::compute

Struct FilterMask

Source
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

Source

pub fn new_true(length: usize) -> Self

Create a new FilterMask where all values are set.

Source

pub fn new_false(length: usize) -> Self

Create a new FilterMask where no values are set.

Source

pub fn from_buffer(buffer: BooleanBuffer) -> Self

Create a new FilterMask from a BooleanBuffer.

Source

pub fn from_indices(len: usize, vec: Vec<usize>) -> Self

Create a new FilterMask from a Vec<usize>.

Source

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.

Source

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.

Source

pub fn len(&self) -> usize

Source

pub fn true_count(&self) -> usize

Get the true count of the mask.

Source

pub fn false_count(&self) -> usize

Get the false count of the mask.

Source

pub fn selectivity(&self) -> f64

Return the selectivity of the full mask.

Source

pub fn boolean_buffer(&self) -> &BooleanBuffer

Get the canonical representation of the mask.

Source

pub fn indices(&self) -> &[usize]

Get the indices of the true values in the mask.

Source

pub fn slices(&self) -> &[(usize, usize)]

Get the slices of the true values in the mask.

Source

pub fn first(&self) -> Option<usize>

Returns the first true index in the mask.

Source

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.

Source

pub fn slice(&self, offset: usize, length: usize) -> Self

Slice the mask.

Source

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

Source§

type Output = FilterMask

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl Clone for FilterMask

Source§

fn clone(&self) -> FilterMask

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilterMask

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<BooleanBuffer> for FilterMask

Source§

fn from(value: BooleanBuffer) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<bool> for FilterMask

Source§

fn from_iter<T: IntoIterator<Item = bool>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl PartialEq for FilterMask

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<ArrayData> for FilterMask

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(array: ArrayData) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Eq for FilterMask

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T