Skip to main content

checked_pruning_expr

Function checked_pruning_expr 

Source
pub fn checked_pruning_expr(
    expr: &Expression,
    available_stats: &FieldPathSet,
) -> Option<(Expression, RequiredStats)>
Expand description

Build a pruning expr mask, using an existing set of stats. The available stats are provided as a set of FieldPath.

A pruning expression is one that returns true for all positions where the original expression cannot hold, and false if it cannot be determined from stats alone whether the positions can be pruned.

Some rewrites, such as is_not_null(...), emit row_count placeholders. The evaluation layer must replace those placeholders with the row count for its current scope before executing the returned expression.

If the falsification logic attempts to access an unknown stat, this function will return None.