Class PushExpressionsToFieldLoad
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<LogicalPlan,LogicalPlan>
org.elasticsearch.xpack.esql.rule.ParameterizedRule<LogicalPlan,LogicalPlan,LocalLogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.local.PushExpressionsToFieldLoad
public class PushExpressionsToFieldLoad
extends ParameterizedRule<LogicalPlan,LogicalPlan,LocalLogicalOptimizerContext>
Replaces
Expressions that can be pushed to field loading with a field attribute
that calculates the expression during value loading. See BlockLoaderExpression
for more about how these loads are implemented and why we do this.
This rule runs in one downward (aka output-to-read) pass, making four sorts of transformations:
-
When we see a use of a new pushable function we build an
attribute for the function, record that attribute, and discard it after use.
For example,
EVAL l = LENGTH(message)becomesEVAL l = $$message$LENGTH$1324$$ | DROP $$message$LENGTH$1324$$. We need theDROPso we don't change the output schema. -
When we see a use of pushable function for which we already have an attribute
we just use it. This looks like the
lattribute inEVAL l = LENGTH(message) | EVAL l2 = LENGTH(message) -
When we see a PROJECT, add any new attributes to the projection so we can use
them on previously visited nodes. So
KEEP foo | EVAL l = LENGTH(message)becomes| KEEP foo, $$message$LENGTH$1324$$ | EVAL l = $$message$LENGTH$1324$$ | DROP $$message$LENGTH$1324$$} - When we see a relation, add the attribute to it.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.elasticsearch.xpack.esql.rule.ParameterizedRule
apply
-
Constructor Details
-
PushExpressionsToFieldLoad
public PushExpressionsToFieldLoad()
-
-
Method Details
-
apply
- Specified by:
applyin classParameterizedRule<LogicalPlan,LogicalPlan, LocalLogicalOptimizerContext>
-