Daft
Daft copied to clipboard
Optimizer: simplify expression optimizer rule
Is your feature request related to a problem? Please describe. Most other rule based execution engines have some form of expression simplification.
Some common optimizations
- inline constant expressions such as
2+2
-4
- simplifying boolean logic
true = true
-true
Additional context other rust based examples
- datafusion: https://github.com/apache/arrow-datafusion/blob/888504a8da6d20f9caf3ecb6cd1a6b7d1956e23e/datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs
- polars: https://github.com/pola-rs/polars/blob/71495ebb017aacc9bedc9723e33481b2307ac8cd/crates/polars-plan/src/logical_plan/optimizer/simplify_expr.rs