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