Skip to main content

FactorizedPredicate

Trait FactorizedPredicate 

Source
pub trait FactorizedPredicate: Send + Sync {
    // Required methods
    fn evaluate(
        &self,
        chunk: &FactorizedChunk,
        level: usize,
        physical_idx: usize,
    ) -> bool;
    fn target_level(&self) -> Option<usize>;

    // Provided method
    fn evaluate_batch(
        &self,
        chunk: &FactorizedChunk,
        level: usize,
    ) -> LevelSelection { ... }
}
Expand description

A predicate that can be evaluated on factorized data at a specific level.

Unlike regular predicates that evaluate on flat DataChunks, factorized predicates work directly on factorized levels for O(physical) evaluation.

Required Methods§

Source

fn evaluate( &self, chunk: &FactorizedChunk, level: usize, physical_idx: usize, ) -> bool

Evaluates the predicate for a single physical index at a level.

§Arguments
  • chunk - The factorized chunk
  • level - The level to evaluate at
  • physical_idx - The physical index within the level
§Returns

true if the row passes the predicate

Source

fn target_level(&self) -> Option<usize>

Returns the level this predicate operates on.

Returns None for predicates that span multiple levels.

Provided Methods§

Source

fn evaluate_batch( &self, chunk: &FactorizedChunk, level: usize, ) -> LevelSelection

Evaluates the predicate for all physical indices at a level.

Returns a LevelSelection representing which indices pass. Default implementation calls evaluate for each index.

Implementors§