Class ReplaceStatsFilteredAggWithEval
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<LogicalPlan,LogicalPlan>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule<LogicalPlan>
org.elasticsearch.xpack.esql.optimizer.rules.logical.ReplaceStatsFilteredAggWithEval
- All Implemented Interfaces:
OptimizerRules.CoordinatorOnly,OptimizerRules.LocalAware<LogicalPlan>
public class ReplaceStatsFilteredAggWithEval
extends OptimizerRules.OptimizerRule<LogicalPlan>
implements OptimizerRules.CoordinatorOnly
Replaces an aggregation function having a false/null filter with an EVAL node.
... | STATS/INLINE STATS x = someAgg(y) WHERE FALSE {BY z} | ...
=>
... | STATS/INLINE STATS x = someAgg(y) {BY z} > | EVAL x = NULL | KEEP x{, z} | ...
This rule is applied to both STATS' Aggregate and InlineJoin right-hand side Aggregate plans.
The logic is common for both, but the handling of the InlineJoin is slightly different when it comes to pruning
its right-hand side Aggregate.
Skipped in local optimizer: once a fragment contains an Agg, this can no longer be pruned, which the rule can do-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule
applyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.CoordinatorOnly
local
-
Constructor Details
-
ReplaceStatsFilteredAggWithEval
public ReplaceStatsFilteredAggWithEval()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.OptimizerRule<LogicalPlan>
-