Class InlineJoin
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,PostOptimizationVerificationAware,Resolvable,ExecutesOn,SortAgnostic
Furthermore, this type of join indicates the right side is performing a subquery identical to the left side - meaning its result is required before joining with the left side.
This helps the model since we want any transformation applied to the source to show up on both sides of the join - due the immutability of the tree (which uses value instead of reference semantics), even if the same node instance would be used, any transformation applied on one side (which would create a new source) would not be reflected on the other side (still use the old source instance). This dedicated instance handles that by replacing the source of the right with a StubRelation that simplifies copies the output of the source, making it easy to serialize/deserialize as well as traversing the plan.
-
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
FieldsFields inherited from class org.elasticsearch.xpack.esql.plan.logical.join.Join
UNSUPPORTED_TYPES -
Constructor Summary
ConstructorsConstructorDescriptionInlineJoin(Source source, LogicalPlan left, LogicalPlan right, JoinConfig config) InlineJoin(Source source, LogicalPlan left, LogicalPlan right, JoinType type, List<Attribute> matchFields, List<Attribute> leftFields, List<Attribute> rightFields) -
Method Summary
Modifier and TypeMethodDescriptioncomputeOutput(List<Attribute> left, List<Attribute> right) static InlineJoin.LogicalPlanTuplefirstSubPlan(LogicalPlan optimizedPlan) Finds the "first" (closest to the source command or bottom up in the tree)InlineJoin, replaces theStubRelationof the right-hand side with left-hand side's source and returns a tuple.info()static LogicalPlaninlineData(InlineJoin target, LocalRelation data) TODO: perform better planning Keep the join in place or replace it with an Eval in case no grouping is necessary.replaceChildren(LogicalPlan left, LogicalPlan right) static LogicalPlanreplaceStub(LogicalPlan source, LogicalPlan stubbed) Replaces the stubbed source with the actual source.static LogicalPlanstubSource(UnaryPlan sourcePlan, LogicalPlan target) Replaces the source of the target plan with a stub preserving the output of the source plan.Methods inherited from class org.elasticsearch.xpack.esql.plan.logical.join.Join
computeOutput, config, equals, executesOn, expressionsResolved, hashCode, isRemote, leftReferences, makeReference, output, postAnalysisVerification, postOptimizationVerification, resolved, rightOutputFields, rightReferences, withConfig, writeToMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.BinaryPlan
left, replaceChildren, replaceLeft, replaceRight, rightMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
analyzed, childrenResolved, optimized, preAnalyzed, preOptimized, setAnalyzed, setOptimized, setPreAnalyzed, setPreOptimizedMethods inherited from class org.elasticsearch.xpack.esql.plan.QueryPlan
computeExpressions, computeReferences, expressions, forEachExpression, forEachExpression, forEachExpressionDown, forEachExpressionUp, inputSet, outputSet, 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, transformUp
-
Field Details
-
ENTRY
-
-
Constructor Details
-
InlineJoin
-
InlineJoin
public InlineJoin(Source source, LogicalPlan left, LogicalPlan right, JoinType type, List<Attribute> matchFields, List<Attribute> leftFields, List<Attribute> rightFields)
-
-
Method Details
-
stubSource
Replaces the source of the target plan with a stub preserving the output of the source plan. -
inlineData
TODO: perform better planning Keep the join in place or replace it with an Eval in case no grouping is necessary. -
replaceStub
Replaces the stubbed source with the actual source. NOTE: this will replace allStubRelations found with the source and the method is meant to be used to replace one node only when being called on a plan that has only ONE StubRelation in it. -
firstSubPlan
Finds the "first" (closest to the source command or bottom up in the tree)InlineJoin, replaces theStubRelationof the right-hand side with left-hand side's source and returns a tuple. Original optimized plan: Limit[1000[INTEGER],true] \_InlineJoin[LEFT,[],[],[]] |_Limit[1000[INTEGER],false] | \_LocalRelation[[x{r}#99],[IntVectorBlock[vector=ConstantIntVector[positions=1, value=1]]]] \_Aggregate[[],[MAX(x{r}#99,true[BOOLEAN]) AS y#102]] \_StubRelation[[x{r}#99]] Takes the right hand side: Aggregate[[],[MAX(x{r}#99,true[BOOLEAN]) AS y#102]] \_StubRelation[[x{r}#99]]] And uses the left-hand side's source as its source: Aggregate[[],[MAX(x{r}#99,true[BOOLEAN]) AS y#102]] \_Limit[1000[INTEGER],false] \_LocalRelation[[x{r}#99],[IntVectorBlock[vector=ConstantIntVector[positions=1, value=1]]]] -
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable- Overrides:
getWriteableNamein classJoin
-
info
-
replaceChildren
- Overrides:
replaceChildrenin classJoin
-
computeOutput
- Overrides:
computeOutputin classJoin
-