Skip to main content

Predicate

Trait Predicate 

Source
pub trait Predicate: Send + Sync {
    // Required method
    fn evaluate(&self, chunk: &DataChunk, row: usize) -> bool;

    // Provided method
    fn might_match_chunk(&self, _hints: &ChunkZoneHints) -> bool { ... }
}
Expand description

A predicate for filtering rows.

Required Methods§

Source

fn evaluate(&self, chunk: &DataChunk, row: usize) -> bool

Evaluates the predicate for a single row.

Provided Methods§

Source

fn might_match_chunk(&self, _hints: &ChunkZoneHints) -> bool

Returns false if zone map proves no rows in this chunk can match.

This method enables chunk-level filtering optimization. When a chunk has zone map hints attached, the filter operator calls this method first. If it returns false, the entire chunk is skipped without evaluating any rows.

The default implementation is conservative and returns true (might match). Predicates that support zone map checking should override this.

Implementors§