Class CompoundOutputEval<T extends CompoundOutputEval<T>>
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,TelemetryAware,Resolvable,GeneratingPlan<CompoundOutputEval<T>>,Streaming
- Direct Known Subclasses:
RegisteredDomain,UriParts,UserAgent
NOTE: The construction of the initial instance of the CompoundOutputEval subclass computes the output attributes based on
the specific evaluator's output columns and the provided prefix. Therefore, it should be used only when the node is first created.
In order to ensure this, there is no constructor that makes this computation directly. Instead, the initial instance creation should be
done through a static method like createInitialInstance(...) that makes use of the static computeOutputAttributes(java.util.SequencedMap<java.lang.String, java.lang.Class<?>>, java.lang.String, org.elasticsearch.xpack.esql.core.tree.Source)
method.
Any subsequent instance construction, such as deserialization, regeneration with new names, or child replacement, should use the
constructor that directly accepts the output fields.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
LogicalPlan.StageNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.tree.Node
Node.NodeStringFormatNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExpressionThe input by which the evaluation is performed.Fields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedThis constructor is used for the deserialization of aCompoundOutputEvalinstance from aStreamInput.protectedCompoundOutputEval(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes) This constructor directly accepts the output fields. -
Method Summary
Modifier and TypeMethodDescriptioncomputeOutputAttributes(SequencedMap<String, Class<?>> outputColumns, String outputFieldPrefix, Source source) Computes the output attributes based on the provided output columns and prefix.protected AttributeSetBy explicitly returning the references of theinputexpression, we implicitly exclude the generated fields from the references that require resolution.abstract TcreateNewInstance(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes) Creates a new instance of the specificCompoundOutputEvalsubclass with the provided parameters.booleanbooleangetInput()inthashCode()protected NodeInfo<? extends LogicalPlan> info()Normally, you want to use one of the staticcreatemethods to implement this.protected abstract booleaninnerEquals(CompoundOutputEval<?> other) protected abstract intoutput()The ordered list of attributes (i.e.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
allMatch, anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, toString, transformChildren, transformChildren, transformDown, transformDown, transformDown, transformDown, transformDownSkipBranch, 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.common.io.stream.NamedWriteable
getWriteableNameMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.PostAnalysisVerificationAware
postAnalysisVerificationMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.TelemetryAware
telemetryLabel
-
Field Details
-
input
The input by which the evaluation is performed.
-
-
Constructor Details
-
CompoundOutputEval
protected CompoundOutputEval(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes) This constructor directly accepts the output fields. It should be used for deserialization, regeneration with new names, child replacement, or other scenarios where the output fields are already known.- Parameters:
source- the source informationchild- the child logical planinput- the input expressionoutputFieldAttributes- the output attributes
-
CompoundOutputEval
This constructor is used for the deserialization of aCompoundOutputEvalinstance from aStreamInput. Subclasses should call this constructor from their own deserialization constructor.- Parameters:
in- the input stream to read from- Throws:
IOException- if an I/O error occurs
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
computeOutputAttributes
protected static List<Attribute> computeOutputAttributes(SequencedMap<String, Class<?>> outputColumns, String outputFieldPrefix, Source source) Computes the output attributes based on the provided output columns and prefix.- Parameters:
outputColumns- the output columns by which the output attributes should be named and typedoutputFieldPrefix- the prefix to be used for the output field namessource- the source information for the attributes- Returns:
- a list of computed output attributes
-
createNewInstance
public abstract T createNewInstance(Source source, LogicalPlan child, Expression input, List<String> outputFieldNames, List<Attribute> outputFieldAttributes) Creates a new instance of the specificCompoundOutputEvalsubclass with the provided parameters. Subclasses should call their corresponding constructor with the provided arguments and the concrete evaluator instance.- Parameters:
source- the source informationchild- the child logical planinput- the input expressionoutputFieldNames- the output field names, used for the computation of the output attributesoutputFieldAttributes- the output attributes- Returns:
- a new instance of the specific
CompoundOutputEvalsubclass
-
getInput
-
outputFieldNames
-
generatedAttributes
- Specified by:
generatedAttributesin interfaceGeneratingPlan<T extends CompoundOutputEval<T>>
-
computeReferences
By explicitly returning the references of theinputexpression, we implicitly exclude the generated fields from the references that require resolution.- Overrides:
computeReferencesin classQueryPlan<LogicalPlan>- Returns:
- only the input expression references
-
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<T extends CompoundOutputEval<T>>
-
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. -
replaceChild
- Specified by:
replaceChildin classUnaryPlan
-
expressionsResolved
public boolean expressionsResolved()- Specified by:
expressionsResolvedin classLogicalPlan
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods to implement this.For
QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Specified by:
infoin classNode<LogicalPlan>
-
innerHashCode
protected abstract int innerHashCode() -
hashCode
public int hashCode() -
innerEquals
-
equals
-