Class HoistRemoteEnrichTopN
java.lang.Object
org.elasticsearch.xpack.esql.rule.Rule<Enrich,LogicalPlan>
org.elasticsearch.xpack.esql.optimizer.rules.logical.OptimizerRules.OptimizerRule<Enrich>
org.elasticsearch.xpack.esql.optimizer.rules.logical.HoistRemoteEnrichTopN
- All Implemented Interfaces:
OptimizerRules.CoordinatorOnly,OptimizerRules.LocalAware<LogicalPlan>
public final class HoistRemoteEnrichTopN
extends OptimizerRules.OptimizerRule<Enrich>
implements OptimizerRules.CoordinatorOnly
Locate any TopN that is "visible" under remote ENRICH, and make a copy of it above the ENRICH,
while making a copy of the original fields. Mark the original TopN as local.
This is the same idea as
HoistRemoteEnrichLimit but for TopN instead of Limit.
This must happen after ReplaceLimitAndSortAsTopN.
This also has handling for the case where Enrich overrides the field(s) TopN is using. In this case,
we need to create aliases for the fields used by TopN, and then use those aliases in the copy TopN.
Then we need to add Project to remove the alias fields. Fortunately, PushDownUtils has the logic to do that.-
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
-
HoistRemoteEnrichTopN
public HoistRemoteEnrichTopN()
-
-
Method Details
-
rule
- Specified by:
rulein classOptimizerRules.OptimizerRule<Enrich>
-