Class Enrich
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<LogicalPlan>
org.elasticsearch.xpack.esql.plan.QueryPlan<LogicalPlan>
org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
org.elasticsearch.xpack.esql.plan.logical.UnaryPlan
org.elasticsearch.xpack.esql.plan.logical.Enrich
- All Implemented Interfaces:
NamedWriteable,Writeable,PostOptimizationVerificationAware,TelemetryAware,Resolvable,GeneratingPlan<Enrich>,ExecutesOn,SortAgnostic
public class Enrich
extends UnaryPlan
implements GeneratingPlan<Enrich>, PostOptimizationVerificationAware, TelemetryAware, SortAgnostic, ExecutesOn
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
LogicalPlan.StageNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.plan.logical.ExecutesOn
ExecutesOn.Coordinator, ExecutesOn.ExecuteLocation, ExecutesOn.RemoteNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnrich(Source source, LogicalPlan child, Enrich.Mode mode, Expression policyName, NamedExpression matchField, EnrichPolicy policy, Map<String, String> concreteIndices, List<NamedExpression> enrichFields) -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeSetThis very likely needs to be overridden forQueryPlan.references()to be correct when inheriting.booleanbooleaninthashCode()protected NodeInfo<? extends LogicalPlan> info()mode()output()The ordered list of attributes (i.e.policy()voidpostOptimizationVerification(Failures failures) Validates the implementing expression - discovered failures are reported to the givenFailuresclass.replaceChild(LogicalPlan newChild) withGeneratedNames(List<String> newNames) Create a new instance of this node with new outputAttributes using the given names.voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.plan.logical.UnaryPlan
child, inputSet, outputSet, replaceChildrenMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
analyzed, childrenResolved, optimized, preAnalyzed, preOptimized, resolved, setAnalyzed, setOptimized, setPreAnalyzed, setPreOptimizedMethods inherited from class org.elasticsearch.xpack.esql.plan.QueryPlan
computeExpressions, expressions, forEachExpression, forEachExpression, forEachExpressionDown, forEachExpressionUp, references, transformExpressionsDown, transformExpressionsDown, transformExpressionsOnly, transformExpressionsOnly, transformExpressionsOnlyUp, transformExpressionsUp, transformExpressionsUpMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.plan.GeneratingPlan
checkNumberOfNewNamesMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.TelemetryAware
telemetryLabel
-
Field Details
-
ENTRY
-
-
Constructor Details
-
Enrich
public Enrich(Source source, LogicalPlan child, Enrich.Mode mode, Expression policyName, NamedExpression matchField, EnrichPolicy policy, Map<String, String> concreteIndices, List<NamedExpression> enrichFields)
-
-
Method Details
-
executesOn
- Specified by:
executesOnin interfaceExecutesOn
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
matchField
-
enrichFields
-
policy
-
concreteIndices
-
policyName
-
resolvedPolicyName
-
mode
-
computeReferences
Description copied from class:QueryPlanThis very likely needs to be overridden forQueryPlan.references()to be correct when inheriting. This can be called on unresolved plans and therefore must not rely on calls toQueryPlan.output().- Overrides:
computeReferencesin classQueryPlan<LogicalPlan>
-
expressionsResolved
public boolean expressionsResolved()- Specified by:
expressionsResolvedin classLogicalPlan
-
replaceChild
- Specified by:
replaceChildin classUnaryPlan
-
info
- Specified by:
infoin classNode<LogicalPlan>
-
output
Description copied from class:QueryPlanThe ordered list of attributes (i.e. columns) this plan produces when executed. Must be called only on resolved plans, otherwise may throw an exception or return wrong results. -
generatedAttributes
- Specified by:
generatedAttributesin interfaceGeneratingPlan<Enrich>
-
withGeneratedNames
Description copied from interface:GeneratingPlanCreate a new instance of this node with new outputAttributes using the given names. If an output attribute already has the desired name, we continue using it; otherwise, we create a new attribute with a newNameId.- Specified by:
withGeneratedNamesin interfaceGeneratingPlan<Enrich>
-
equals
-
hashCode
public int hashCode() -
postOptimizationVerification
Description copied from interface:PostOptimizationVerificationAwareValidates the implementing expression - discovered failures are reported to the givenFailuresclass.Example: the
Bucketfunction, which produces buckets over a numerical or date field, based on a number of literal arguments needs to check if its arguments are all indeed literals. This is how this verification is performed:@Override public void postOptimizationVerification(Failures failures) { String operation = sourceText(); failures.add(isFoldable(buckets, operation, SECOND)) .add(from != null ? isFoldable(from, operation, THIRD) : null) .add(to != null ? isFoldable(to, operation, FOURTH) : null); }- Specified by:
postOptimizationVerificationin interfacePostOptimizationVerificationAware
-