Class PushDownFilterAndLimitIntoUnionAll
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.ParameterizedOptimizerRule<LogicalPlan,LogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.PushDownFilterAndLimitIntoUnionAll
public class PushDownFilterAndLimitIntoUnionAll
extends OptimizerRules.ParameterizedOptimizerRule<LogicalPlan,LogicalOptimizerContext>
Push down filters that can be evaluated by the
UnionAll branch to each branch, and below Subquery,
so that the filters can be pushed down further to the data source when possible. Filters that cannot be pushed down
remain above the UnionAll.
This rule applies for certain patterns of UnionAll branches. The branches of a UnionAll/Fork plan has a similar
pattern, Fork adds EsqlProject, an optional Eval and an implicit Limit on top of each branch. However
UnionAll branches do not have the implicit Limit appended to each branch, this is difference between Fork
and UnionAll.
In case there is mismatched data types on the same field across different UnionAll branches, a ConvertFunction could
also be added in the optional Eval.
If the patterns of the UnionAll branches do not match the following expected patterns, the rule is not applied.
Project
Eval (optional) - added when the output of each UnionAll branch are not exactly the same
EsRelation
or
Project
Eval (optional)
Subquery
or
Subquery - CombineProjections may remove the EsqlProject on top of the subquery-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LogicalPlanrule(LogicalPlan logicalPlan, LogicalOptimizerContext context) Methods inherited from class org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.ParameterizedOptimizerRule
applyMethods inherited from class org.elasticsearch.xpack.esql.rule.ParameterizedRule
apply
-
Constructor Details
-
PushDownFilterAndLimitIntoUnionAll
public PushDownFilterAndLimitIntoUnionAll()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.ParameterizedOptimizerRule<LogicalPlan,LogicalOptimizerContext>
-