Package io.trino.sql.ir.optimizer.rule
Class SimplifyRedundantCase
java.lang.Object
io.trino.sql.ir.optimizer.rule.SimplifyRedundantCase
- All Implemented Interfaces:
IrOptimizerRule
Simplify CASE expressions with constant TRUE/FALSE results:
Case([When(a, true), When(b, false), When(c, true)], false) -> $identical(Or(a, c), true)Case([When(a, true), When(b, false), When(c, false)], true) -> $not($identical(Or(b, c), true)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(Expression expression, Session session, Map<Symbol, Expression> bindings)
-
Constructor Details
-
SimplifyRedundantCase
-
-
Method Details
-
apply
public Optional<Expression> apply(Expression expression, Session session, Map<Symbol, Expression> bindings) - Specified by:
applyin interfaceIrOptimizerRule
-