Class RemoveRedundantCaseClauses
java.lang.Object
io.trino.sql.ir.optimizer.rule.RemoveRedundantCaseClauses
- All Implemented Interfaces:
IrOptimizerRule
Remove duplicated and redundant clauses in Case. E.g.,
Case([When(a, r1), When(b, r2), When(a, r3)], d) -> Switch([When(a, r1), When(b, r2)], d)Case([When(a, r1), When(true, r2), When(a, r3)], d) -> Switch([When(a, r1)], r2)Case([When(a, r1), When(false, r2), When(a, r3)], d) -> Switch([When(a, r1)], d)Case([When(true, r)], d) -> rCase([When(false, r)], d) -> d
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(Expression expression, Session session, Map<Symbol, Expression> bindings)
-
Constructor Details
-
RemoveRedundantCaseClauses
public RemoveRedundantCaseClauses()
-
-
Method Details
-
apply
public Optional<Expression> apply(Expression expression, Session session, Map<Symbol, Expression> bindings) - Specified by:
applyin interfaceIrOptimizerRule
-