Class PruneEmptyForkBranches
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<Fork,LogicalPlan>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule<Fork>
org.elasticsearch.xpack.esql.optimizer.rules.logical.PruneEmptyForkBranches
Removes FORK branches or subqueries from UnionAll that only contain an empty LocalRelation.
The simplest case where this can happen is when a FORK branch contains
WHERE false.
In practice, empty FORK branches can also happen when FORK is used for conditional execution of the query
based on query parameters:
FROM my-index METADATA _score
| ...
| FORK ( SORT _score | LIMIT 10) // return top hits every time
( WHERE ?include_completion | STATS s = values(title) | COMPLETION ...)
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule
apply
-
Constructor Details
-
PruneEmptyForkBranches
public PruneEmptyForkBranches()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.OptimizerRule<Fork>
-