Class InferNonNullAggConstraint
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<Aggregate,LogicalPlan>
org.elasticsearch.xpack.esql.rule.ParameterizedRule<Aggregate,LogicalPlan,LocalLogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.ParameterizedOptimizerRule<Aggregate,LocalLogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.local.InferNonNullAggConstraint
public class InferNonNullAggConstraint
extends OptimizerRules.ParameterizedOptimizerRule<Aggregate,LocalLogicalOptimizerContext>
The vast majority of aggs ignore null entries - this rule adds a pushable filter, as it is cheap
to execute, to filter these entries out to begin with.
STATS x = min(a), y = sum(b)
becomes
| WHERE a IS NOT NULL OR b IS NOT NULL
| STATS x = min(a), y = sum(b)
Unfortunately this optimization cannot be applied when grouping is necessary since it can filter out groups containing only null values
Unfortunately this optimization cannot be applied when grouping is necessary since it can filter out groups containing only null values
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LogicalPlanrule(Aggregate aggregate, LocalLogicalOptimizerContext 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
-
InferNonNullAggConstraint
public InferNonNullAggConstraint()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.ParameterizedOptimizerRule<Aggregate,LocalLogicalOptimizerContext>
-