Class Join
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.BinaryPlan
org.elasticsearch.xpack.esql.plan.logical.join.Join
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,Resolvable,SortAgnostic
- Direct Known Subclasses:
InlineJoin,LookupJoin
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
LogicalPlan.StageNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NamedWriteableRegistry.Entrystatic final DataType[] -
Constructor Summary
ConstructorsConstructorDescriptionJoin(StreamInput in) Join(Source source, LogicalPlan left, LogicalPlan right, JoinConfig config) Join(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) computeOutput(List<Attribute> leftOutput, List<Attribute> rightOutput, JoinConfig config) Combine the two lists of attributes into one.config()booleanbooleaninthashCode()info()makeReference(List<Attribute> output) Make fields references, so we don't check if they exist in the index.output()The ordered list of attributes (i.e.voidpostAnalysisVerification(Failures failures) Allows the implementer to validate itself.replaceChildren(LogicalPlan left, LogicalPlan right) booleanresolved()The output fields obtained from the right child.withConfig(JoinConfig config) voidwriteTo(StreamOutput out) Methods 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, setAnalyzed, setOptimized, setPreAnalyzedMethods inherited from class org.elasticsearch.xpack.esql.plan.QueryPlan
computeExpressions, computeReferences, expressions, forEachExpression, forEachExpression, forEachExpressionDown, forEachExpressionDown, forEachExpressionUp, 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, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, transformChildren, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp
-
Field Details
-
ENTRY
-
UNSUPPORTED_TYPES
-
-
Constructor Details
-
Join
-
Join
public Join(Source source, LogicalPlan left, LogicalPlan right, JoinType type, List<Attribute> matchFields, List<Attribute> leftFields, List<Attribute> rightFields) -
Join
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
config
-
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.- Specified by:
outputin classQueryPlan<LogicalPlan>
-
leftReferences
- Specified by:
leftReferencesin classBinaryPlan
-
rightReferences
- Specified by:
rightReferencesin classBinaryPlan
-
rightOutputFields
The output fields obtained from the right child. -
computeOutput
-
computeOutput
public static List<Attribute> computeOutput(List<Attribute> leftOutput, List<Attribute> rightOutput, JoinConfig config) Combine the two lists of attributes into one. In case of (name) conflicts, specify which sides wins, that is overrides the other column - the left or the right. -
makeReference
Make fields references, so we don't check if they exist in the index. We do this for fields that we know don't come from the index.It's important that name is returned as a *reference* here instead of a field. If it were a field we'd use SearchStats on it and discover that it doesn't exist in the index. It doesn't! We don't expect it to. It exists only in the lookup table. TODO we should rework stats so we don't have to do this
-
expressionsResolved
public boolean expressionsResolved()- Specified by:
expressionsResolvedin classLogicalPlan
-
resolved
public boolean resolved()- Specified by:
resolvedin interfaceResolvable- Overrides:
resolvedin classLogicalPlan
-
withConfig
-
replaceChildren
- Specified by:
replaceChildrenin classBinaryPlan
-
hashCode
public int hashCode()- Overrides:
hashCodein classBinaryPlan
-
equals
- Overrides:
equalsin classBinaryPlan
-
postAnalysisVerification
Description copied from interface:PostAnalysisVerificationAwareAllows the implementer to validate itself. This usually involves checking its internal setup, which often means checking the parameters it received on construction: their data or syntactic type, class, their count, expressions' structure etc. The discovered failures are added to the givenFailuresobject.It is often more useful to perform the checks as extended as it makes sense, over stopping at the first failure. This will allow the author to progress faster to a correct query.
Example: the
Filterclass, which models the WHERE command, checks that the expression it filters on -condition- is of a Boolean or NULL type:@Override void postAnalysisVerification(Failures failures) { if (condition.dataType() != NULL && condition.dataType() != BOOLEAN) { failures.add(fail(condition, "Condition expression needs to be boolean, found [{}]", condition.dataType())); } }- Specified by:
postAnalysisVerificationin interfacePostAnalysisVerificationAware- Parameters:
failures- the object to add failures to.
-