Class PushDownJoinPastProject
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<Join,LogicalPlan>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule<Join>
org.elasticsearch.xpack.esql.optimizer.rules.logical.PushDownJoinPastProject
If a
Project is found in the left child of a left Join, perform it after. Due to requiring the projected attributes
later, field extractions can also happen later, making joins cheaper to execute on data nodes.
E.g. ... | RENAME field AS otherfield | LOOKUP JOIN lu_idx ON key
becomes ... | LOOKUP JOIN lu_idx ON key | RENAME field AS otherfield .
When a LOOKUP JOIN's lookup fields shadow the previous fields, we need to leave an Eval in place of the Project
to assign a temporary name. Assume that field is a lookup-added field, then
... | RENAME field AS otherfield | LOOKUP JOIN lu_idx ON key
becomes something like
... | EVAL $$field = field | LOOKUP JOIN lu_idx ON key | RENAME $$field AS otherfield.
Leaving EVAL $$field = field in place of the original projection, rather than a Project, avoids infinite loops.-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule
apply
-
Constructor Details
-
PushDownJoinPastProject
public PushDownJoinPastProject()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.OptimizerRule<Join>
-