simplify_column_predicates

Function simplify_column_predicates 

Source
fn simplify_column_predicates(predicates: Vec<Expr>) -> Result<Vec<Expr>>
Expand description

Simplifies predicates related to a single column.

This function processes a list of predicates that all reference the same column and simplifies them based on their operators. It groups predicates into greater-than (>, >=), less-than (<, <=), and equality (=) categories, then selects the most restrictive condition in each category to reduce redundancy. For example, among x > 5 and x > 6, only x > 6 is retained as it is more restrictive.

§Arguments

  • predicates - A vector of Expr representing predicates for a single column.

§Returns

A Result containing a vector of simplified Expr predicates for the column.