pub fn rewrite_with_guarantees<'a>(
expr: Expr,
guarantees: impl IntoIterator<Item = &'a (Expr, NullableInterval)>,
) -> Result<Transformed<Expr>>Expand description
Rewrite expressions to incorporate guarantees.
Guarantees are a mapping from an expression (which currently is always a column reference) to a NullableInterval that represents the known possible values of the expression.
Rewriting expressions using this type of guarantee can make the work of other expression simplifications, like const evaluation, easier.
For example, if we know that a column is not null and has values in the
range [1, 10), we can rewrite x IS NULL to false or x < 10 to true.
If the set of guarantees will be used to rewrite more than one expression, consider using rewrite_with_guarantees_map instead.
A full example of using this rewrite rule can be found in
ExprSimplifier::with_guarantees().