vortex_array::compute

Struct FilterMask

Source
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

Source

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.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

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 range_selectivity(&self) -> f64

Return the selectivity of the range of true values of the mask.

Source

pub fn to_boolean_buffer(&self) -> VortexResult<BooleanBuffer>

Get the canonical representation of the mask.

Source

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.

Source

pub fn iter_slices( &self, ) -> VortexResult<impl Iterator<Item = (usize, usize)> + '_>

👎Deprecated: Move to using iter() instead
Source

pub fn iter_indices(&self) -> VortexResult<impl Iterator<Item = usize> + '_>

👎Deprecated: Move to using iter() instead

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.

Source§

fn clone(&self) -> Self

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 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.

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<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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T