Class RemoveStatsOverride
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<Aggregate,LogicalPlan>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule<Aggregate>
org.elasticsearch.xpack.esql.optimizer.rules.logical.RemoveStatsOverride
Removes
Aggregate overrides in grouping, aggregates and across them inside.
The overrides appear when the same alias is used multiple times in aggregations
and/or groupings:
STATS x = COUNT(*), x = MIN(a) BY x = b + 1, x = c + 10
becomes
STATS BY x = c + 10
and
INLINESTATS x = COUNT(*), x = MIN(a) BY x = b + 1, x = c + 10
becomes
INLINESTATS BY x = c + 10
This is "last one wins", with groups having priority over aggregates.
Separately, it replaces expressions used as group keys inside the aggregates with references:
STATS max(a + b + 1) BY a + b
becomes
STATS max($x + 1) BY $x = a + b-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule
apply
-
Constructor Details
-
RemoveStatsOverride
public RemoveStatsOverride()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.OptimizerRule<Aggregate>
-