Class CombineDisjunctions
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<LogicalPlan,LogicalPlan>
org.elasticsearch.xpack.esql.rule.ParameterizedRule<LogicalPlan,LogicalPlan,LogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerExpressionRule<Or>
org.elasticsearch.xpack.esql.optimizer.rules.logical.CombineDisjunctions
Combine disjunctive Equals, In or CIDRMatch expressions on the same field into an In or CIDRMatch expression.
This rule looks for both simple equalities:
1. a == 1 OR a == 2 becomes a IN (1, 2)
and combinations of In
2. a == 1 OR a IN (2) becomes a IN (1, 2)
3. a IN (1) OR a IN (2) becomes a IN (1, 2)
and combinations of CIDRMatch
4. CIDRMatch(a, ip1) OR CIDRMatch(a, ip2) OR a == ip3 or a IN (ip4, ip5) becomes CIDRMatch(a, ip1, ip2, ip3, ip4, ip5)
This rule does NOT check for type compatibility as that phase has been already be verified in the analyzer.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static CIDRMatchcreateCIDRMatch(Expression k, List<Expression> v) protected static EqualscreateEquals(Expression k, Set<Expression> v, ZoneId finalZoneId) protected static IncreateIn(Expression key, List<Expression> values, ZoneId zoneId) rule(Or or, LogicalOptimizerContext ctx) Methods inherited from class org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerExpressionRule
apply, expressionToken, shouldVisitMethods inherited from class org.elasticsearch.xpack.esql.rule.ParameterizedRule
apply
-
Constructor Details
-
CombineDisjunctions
public CombineDisjunctions()
-
-
Method Details
-
createIn
-
createEquals
-
createCIDRMatch
-
rule
- Specified by:
rulein classOptimizerRules.OptimizerExpressionRule<Or>
-