Class PushDownAndCombineSample
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<Sample,LogicalPlan>
org.elasticsearch.xpack.esql.rule.ParameterizedRule<Sample,LogicalPlan,LogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.ParameterizedOptimizerRule<Sample,LogicalOptimizerContext>
org.elasticsearch.xpack.esql.optimizer.rules.logical.PushDownAndCombineSample
public class PushDownAndCombineSample
extends OptimizerRules.ParameterizedOptimizerRule<Sample,LogicalOptimizerContext>
Pushes down the SAMPLE operator. SAMPLE can be pushed down through an
operator if
| SAMPLE p | OPERATOR
is equivalent to
| OPERATOR | SAMPLE p
statistically (i.e. same possible output with same probabilities). In that case, we push down sampling to Lucene for efficiency.
As a rule of thumb, if an operator can be swapped with sampling if it maps:
-
one row to one row (e.g.
DISSECT,DROP,ENRICH,EVAL,GROK,KEEP,RENAME) -
one row to zero or one row (
WHERE) -
reorders the rows (
SORT)
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LogicalPlanrule(Sample sample, LogicalOptimizerContext 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
-
PushDownAndCombineSample
public PushDownAndCombineSample()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.ParameterizedOptimizerRule<Sample,LogicalOptimizerContext>
-