Class AntiJoin
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
org.elasticsearch.xpack.esql.plan.logical.join.AbstractSubqueryJoin
org.elasticsearch.xpack.esql.plan.logical.join.AntiJoin
- All Implemented Interfaces:
NamedWriteable,Writeable,PostAnalysisVerificationAware,PostOptimizationVerificationAware,Resolvable,ExecutesOn,ExecutesOn.Coordinator,SortAgnostic,SortPreserving
An anti join used to implement
WHERE field NOT IN (subquery).
The dual of SemiJoin: it shares the AbstractSubqueryJoin dedup pipeline and only flips the hooks that distinguish
NOT IN from IN — it uses JoinTypes.ANTI, wraps the inline filter in Not, keeps unmatched rows on the
hash-join path (IS NULL on the sentinel), and short-circuits to Filter(FALSE) on any NULL right value.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.join.AbstractSubqueryJoin
AbstractSubqueryJoin.LogicalPlanTupleNested 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.xpack.esql.plan.logical.ExecutesOn
ExecutesOn.Coordinator, ExecutesOn.ExecuteLocation, ExecutesOn.RemoteNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.capabilities.PostOptimizationVerificationAware
PostOptimizationVerificationAware.CoordinatorOnlyNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.xpack.esql.plan.logical.join.Join
ENTRY, UNSUPPORTED_TYPESFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionAntiJoin(Source source, LogicalPlan left, LogicalPlan right, List<Attribute> leftFields, List<Attribute> rightFields) AntiJoin(Source source, LogicalPlan left, LogicalPlan right, JoinConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected LogicalPlanbuildEmptyRightSidePlan(Source source) Build the terminal plan when the right side has zero rows.info()Normally, you want to use one of the staticcreatemethods to implement this.replaceChildren(LogicalPlan left, LogicalPlan right) protected ExpressionsentinelFilterCondition(Source source, Attribute sentinel) Sentinel-column filter that drives the hash-join path.protected booleanWhether any NULL on the right side makes the predicate non-TRUE for every left row.protected ExpressionwrapInExpression(Source source, Expression in) Wraps theInexpression built from the dedup keys for the inline-filter path.Methods inherited from class org.elasticsearch.xpack.esql.plan.logical.join.AbstractSubqueryJoin
buildFilterPathPlan, buildHashJoinPathPlan, buildShortCircuitPlan, computeOutputExpressions, expressionsResolved, filterNullLeftKeysBeforeHashJoin, firstSubPlan, getWriteableName, inlineData, inListFromDedupKeys, isSubqueryJoinUnsupported, newMainPlan, postAnalysisVerification, writeToMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.join.Join
computeOutputExpressions, config, equals, executesOn, getRightToSerialize, hashCode, isRemote, leftReferences, makeReference, output, postOptimizationVerification, resolved, rightOutputFields, rightReferences, withConfigMethods 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
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, 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.logical.ExecutesOn.Coordinator
executesOnMethods inherited from interface org.elasticsearch.xpack.esql.capabilities.PostAnalysisVerificationAware
postAnalysisVerification
-
Constructor Details
-
AntiJoin
-
AntiJoin
public AntiJoin(Source source, LogicalPlan left, LogicalPlan right, List<Attribute> leftFields, List<Attribute> rightFields)
-
-
Method Details
-
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. -
replaceChildren
- Overrides:
replaceChildrenin classJoin
-
buildEmptyRightSidePlan
Description copied from class:AbstractSubqueryJoinBuild the terminal plan when the right side has zero rows.x IN ()≡ FALSE for SEMI / MARK;x NOT IN ()≡ TRUE for ANTI. MarkJoin produces an Eval that sets the mark attribute to FALSE.- Specified by:
buildEmptyRightSidePlanin classAbstractSubqueryJoin
-
shortCircuitOnAnyRightNull
protected boolean shortCircuitOnAnyRightNull()Description copied from class:AbstractSubqueryJoinWhether any NULL on the right side makes the predicate non-TRUE for every left row. For ANTI (x NOT IN (..., NULL, ...)) this is always the case, so onceAbstractSubqueryJoin.inlineData(org.elasticsearch.xpack.esql.plan.logical.join.AbstractSubqueryJoin, org.elasticsearch.xpack.esql.plan.logical.local.LocalRelation, int, org.elasticsearch.compute.data.BlockFactory, java.util.concurrent.atomic.AtomicReference<org.elasticsearch.compute.data.Page>)detects a NULL position in the BlockHash dedup output it short-circuits toFilter(FALSE). For SEMI the NULL stays in the dedup output for the filter path (x IN (a, b, NULL)≡x IN (a, b)under WHERE semantics) and is stripped before constructing theLocalRelationon the hash-join path. For MARK therightHadNullsflag is forwarded to the hash-join path's CASE expression; the filter path uses the NULL position in the dedup output directly.- Overrides:
shortCircuitOnAnyRightNullin classAbstractSubqueryJoin
-
wrapInExpression
Description copied from class:AbstractSubqueryJoinWraps theInexpression built from the dedup keys for the inline-filter path. SEMI returns it as-is; ANTI wraps it inNot.- Overrides:
wrapInExpressionin classAbstractSubqueryJoin
-
sentinelFilterCondition
Description copied from class:AbstractSubqueryJoinSentinel-column filter that drives the hash-join path. SEMI keeps matched rows (IS NOT NULLon the sentinel); ANTI keeps unmatched rows (IS NULL).- Overrides:
sentinelFilterConditionin classAbstractSubqueryJoin
-