Skip to main content

fold_constants

Function fold_constants 

Source
pub fn fold_constants(expr: &Expr) -> Expr
Expand description

Folds constant sub-expressions in a DataFusion [Expr] tree.

Handles:

  • Arithmetic on literal pairs (Literal op Literal)
  • Boolean identity rules (true AND xx, false OR xx, etc.)
  • Recursive descent into BinaryExpr, Not children

Returns a (possibly simplified) clone of the input expression.