Package com.darkcollective.relix.plan
Record Class PhysicalNode.Join
java.lang.Object
java.lang.Record
com.darkcollective.relix.plan.PhysicalNode.Join
- Record Components:
condition- the join predicate; empty forPhysicalNode.JoinKind.NATURALandPhysicalNode.JoinKind.PRODUCTkeys- the equi-join key columns used for aPhysicalNode.JoinAlgorithm.HASHjoin (forNATURAL, the common columns); empty for a nested-loop join and productsleftRelations- relation names reachable on the left side, used to disambiguate qualified attribute references when re-evaluatingcondition; empty when there is no conditionrightRelations- relation names reachable on the right side
- All Implemented Interfaces:
PhysicalNode
- Enclosing interface:
PhysicalNode
public static record PhysicalNode.Join(Schema schema, PhysicalNode.JoinKind kind, PhysicalNode.JoinAlgorithm algorithm, PhysicalNode.BuildSide buildSide, Optional<Predicate> condition, PhysicalNode.JoinKeys keys, Set<String> leftRelations, Set<String> rightRelations, PhysicalNode left, PhysicalNode right)
extends Record
implements PhysicalNode
A join of any kind, carrying the chosen physical strategy.
A PhysicalNode.JoinAlgorithm.MERGE join advertises
the order its sorted-merge scan produces, so a downstream merge join, streaming
δ, or streaming γ can reuse it instead of re-sorting rows that
are already in order.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.darkcollective.relix.plan.PhysicalNode
PhysicalNode.Aggregate, PhysicalNode.AsOfJoin, PhysicalNode.BernoulliSample, PhysicalNode.BuildSide, PhysicalNode.Closure, PhysicalNode.Cluster, PhysicalNode.ConstructiveCover, PhysicalNode.Cover, PhysicalNode.Distinct, PhysicalNode.Division, PhysicalNode.Downsample, PhysicalNode.Empty, PhysicalNode.Fixpoint, PhysicalNode.IntervalJoin, PhysicalNode.Iterate, PhysicalNode.Join, PhysicalNode.JoinAlgorithm, PhysicalNode.JoinKeys, PhysicalNode.JoinKind, PhysicalNode.LateralJoin, PhysicalNode.Limit, PhysicalNode.Optimize, PhysicalNode.Path, PhysicalNode.Pivot, PhysicalNode.Project, PhysicalNode.PushedScan, PhysicalNode.RecursiveRef, PhysicalNode.Rename, PhysicalNode.ReservoirSample, PhysicalNode.Scan, PhysicalNode.Select, PhysicalNode.Sessionize, PhysicalNode.SetKind, PhysicalNode.SetOp, PhysicalNode.Solve, PhysicalNode.Sort, PhysicalNode.Spool, PhysicalNode.TopK, PhysicalNode.Trace, PhysicalNode.Tree, PhysicalNode.Universal, PhysicalNode.Unnest, PhysicalNode.Unpivot, PhysicalNode.Why, PhysicalNode.Window -
Constructor Summary
ConstructorsConstructorDescriptionJoin(Schema schema, PhysicalNode.JoinKind kind, PhysicalNode.JoinAlgorithm algorithm, PhysicalNode.BuildSide buildSide, Optional<Predicate> condition, PhysicalNode.JoinKeys keys, Set<String> leftRelations, Set<String> rightRelations, PhysicalNode left, PhysicalNode right) Creates an instance of aJoinrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.Returns the value of thebuildSiderecord component.children()Direct child plans, left-to-right; empty for aPhysicalNode.Scan.Returns the value of theconditionrecord component.The order aPhysicalNode.JoinAlgorithm.MERGEjoin delivers;Ordering.none()for every other algorithm (a hash or nested-loop scan makes no order promise).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.keys()Returns the value of thekeysrecord component.kind()Returns the value of thekindrecord component.left()Returns the value of theleftrecord component.Returns the value of theleftRelationsrecord component.right()Returns the value of therightrecord component.Returns the value of therightRelationsrecord component.schema()Returns the value of theschemarecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.darkcollective.relix.plan.PhysicalNode
mapChildren
-
Constructor Details
-
Join
public Join(Schema schema, PhysicalNode.JoinKind kind, PhysicalNode.JoinAlgorithm algorithm, PhysicalNode.BuildSide buildSide, Optional<Predicate> condition, PhysicalNode.JoinKeys keys, Set<String> leftRelations, Set<String> rightRelations, PhysicalNode left, PhysicalNode right) Creates an instance of aJoinrecord class.- Parameters:
schema- the value for theschemarecord componentkind- the value for thekindrecord componentalgorithm- the value for thealgorithmrecord componentbuildSide- the value for thebuildSiderecord componentcondition- the value for theconditionrecord componentkeys- the value for thekeysrecord componentleftRelations- the value for theleftRelationsrecord componentrightRelations- the value for therightRelationsrecord componentleft- the value for theleftrecord componentright- the value for therightrecord component
-
-
Method Details
-
children
Description copied from interface:PhysicalNodeDirect child plans, left-to-right; empty for aPhysicalNode.Scan.- Specified by:
childrenin interfacePhysicalNode
-
deliveredOrdering
The order aPhysicalNode.JoinAlgorithm.MERGEjoin delivers;Ordering.none()for every other algorithm (a hash or nested-loop scan makes no order promise). The left key column names are the ones that survive intoschema()— a concatenated schema keeps the left names verbatim and only disambiguates duplicated right ones, a natural join keeps the common column from the left, and a semi/anti join's schema is the left schema — so the keys named here are always addressable in the output.What is claimed depends on the join kind:
INNER/NATURAL— the merge keys, ascending: the scan visits equal-key batches in ascending key order, so the key columns are ordered on the output regardless of how a batch's rows are paired. Built byPlanner.mergeOrdering(java.util.List<java.lang.Integer>, com.darkcollective.relix.symbol.Schema)— the same call the planner uses to decide the merge is feasible, so the required and delivered orderings cannot drift apart.SEMI— the left input's delivered ordering, which is at least as strong as the merge keys: the output rows are left rows, emitted as a subsequence of the left stream.ANTI— nothing. The anti-join executor emits left rows with a NULL join key ahead of the sorted run (they can never match), while an ASC sort places NULLs last, so the output is not in key order.Orderinghas no null-placement dimension to express the difference, so the honest answer isnone().
The other kinds never reach
MERGE(seePlanner.mergeEligible), and fall through tonone()if one ever does.NULL placement does not otherwise arise here: the merge executor filters NULL-key rows out of both inputs before scanning, so — the anti-join case above aside — no NULL key reaches the output to be placed.
- Specified by:
deliveredOrderingin interfacePhysicalNode- Returns:
- the delivered ordering; never null
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
schema
Returns the value of theschemarecord component.- Specified by:
schemain interfacePhysicalNode- Returns:
- the value of the
schemarecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
algorithm
Returns the value of thealgorithmrecord component.- Returns:
- the value of the
algorithmrecord component
-
buildSide
Returns the value of thebuildSiderecord component.- Returns:
- the value of the
buildSiderecord component
-
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
keys
Returns the value of thekeysrecord component.- Returns:
- the value of the
keysrecord component
-
leftRelations
Returns the value of theleftRelationsrecord component.- Returns:
- the value of the
leftRelationsrecord component
-
rightRelations
Returns the value of therightRelationsrecord component.- Returns:
- the value of the
rightRelationsrecord component
-
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-