pub struct FilterIndex { /* private fields */ }Expand description
A filter over physical row IDs, backed by a Roaring Bitmap.
Construct from matching row IDs or from an Arrow BooleanArray,
then apply to a PermutationIndex to get a filtered selection vector.
Implementations§
Source§impl FilterIndex
impl FilterIndex
Sourcepub fn from_ids(ids: impl IntoIterator<Item = u32>) -> Self
pub fn from_ids(ids: impl IntoIterator<Item = u32>) -> Self
Construct from an iterator of matching physical row IDs.
Sourcepub fn from_boolean_array(arr: &BooleanArray) -> Self
pub fn from_boolean_array(arr: &BooleanArray) -> Self
Construct from an Arrow BooleanArray where true = passes filter.
Null values are treated as false (do not pass filter).
Sourcepub fn contains(&self, id: u32) -> bool
pub fn contains(&self, id: u32) -> bool
Check whether a specific physical row ID passes the filter.
Sourcepub fn apply_to_permutation(
&self,
permutation: &PermutationIndex,
) -> PermutationIndex
pub fn apply_to_permutation( &self, permutation: &PermutationIndex, ) -> PermutationIndex
Apply this filter to a sorted permutation, returning a new PermutationIndex
containing only the permuted rows that pass the filter, in sort order.
This is the core composition operation:
sorted_and_filtered = filter.apply_to_permutation(&sorted)
Processes in chunks to avoid reading entire mmap indices at once. Time: O(n) where n = permutation length, with O(1) membership checks via the Roaring Bitmap.
Sourcepub fn intersection(&self, other: &FilterIndex) -> FilterIndex
pub fn intersection(&self, other: &FilterIndex) -> FilterIndex
Intersect two filters (AND semantics).
Sourcepub fn union(&self, other: &FilterIndex) -> FilterIndex
pub fn union(&self, other: &FilterIndex) -> FilterIndex
Union two filters (OR semantics).
Sourcepub fn negate(&self, total_rows: u32) -> FilterIndex
pub fn negate(&self, total_rows: u32) -> FilterIndex
Negate filter within a universe of total_rows physical rows.
Returns a filter containing all rows in [0, total_rows) that are
NOT in the current filter. Uses insert_range for O(containers)
universe construction instead of O(elements) iteration.
Sourcepub fn difference(&self, other: &FilterIndex) -> FilterIndex
pub fn difference(&self, other: &FilterIndex) -> FilterIndex
Set difference: rows in self but not in other.
Equivalent to self ∩ ¬other, but without allocating the negation.
Sourcepub fn into_boolean_array(&self, total_rows: u32) -> BooleanArray
pub fn into_boolean_array(&self, total_rows: u32) -> BooleanArray
Convert to a BooleanArray of length total_rows.
true at position i means physical row i passes the filter.
Trait Implementations§
Source§impl Clone for FilterIndex
impl Clone for FilterIndex
Source§fn clone(&self) -> FilterIndex
fn clone(&self) -> FilterIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FilterIndex
impl RefUnwindSafe for FilterIndex
impl Send for FilterIndex
impl Sync for FilterIndex
impl Unpin for FilterIndex
impl UnsafeUnpin for FilterIndex
impl UnwindSafe for FilterIndex
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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