Package com.darkcollective.relix.plan
Record Class PhysicalNode.AsOfJoin
java.lang.Object
java.lang.Record
com.darkcollective.relix.plan.PhysicalNode.AsOfJoin
- Record Components:
partitionKeys- the equality (partition) key columns, left/right indicesleftMatchIndex- the probe's match (ordering) column indexrightMatchIndex- the right input's match (ordering) column indextolerance- optional maximum temporal distance for the matchinner- whentrue, drop unmatched probestieBreak- tie-break rule for tied nearest-match values
- All Implemented Interfaces:
PhysicalNode
- Enclosing interface:
PhysicalNode
public static record PhysicalNode.AsOfJoin(Schema schema, PhysicalNode.JoinKeys partitionKeys, int leftMatchIndex, int rightMatchIndex, boolean backward, boolean strict, Optional<Duration> tolerance, boolean inner, TieBreak tieBreak, PhysicalNode left, PhysicalNode right)
extends Record
implements PhysicalNode
AS-OF join — a temporal "pick the nearest right row by time" join.
For each left (probe) row, among the right rows agreeing on the
partitionKeys and satisfying the ordering relation between
leftMatchIndex and rightMatchIndex, emits the probe
concatenated with the single nearest right row.
backward selects the direction: true keeps the greatest
right[match] at-or-before the probe ("most recent as-of"), false
keeps the least right[match] at-or-after. strict excludes an
exact-value match (a >/< condition rather than >=/<=).
When inner is false (default, left-outer), every probe
survives with NULL right columns on no match. When true (inner),
unmatched probes are dropped.
An optional tolerance imposes a maximum temporal distance between the
probe and the matched right row; a candidate exceeding the tolerance is treated as
no-match.
tieBreak resolves ties among right rows sharing the nearest match
value: LAST keeps the last in input order (default); FIRST keeps
the first.
-
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
ConstructorsConstructorDescriptionAsOfJoin(Schema schema, PhysicalNode.JoinKeys partitionKeys, int leftMatchIndex, int rightMatchIndex, boolean backward, boolean strict, PhysicalNode left, PhysicalNode right) Convenience constructor preserving backward compatibility (no tolerance, left-outer, LAST).AsOfJoin(Schema schema, PhysicalNode.JoinKeys partitionKeys, int leftMatchIndex, int rightMatchIndex, boolean backward, boolean strict, Optional<Duration> tolerance, boolean inner, TieBreak tieBreak, PhysicalNode left, PhysicalNode right) Creates an instance of aAsOfJoinrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbackward()Returns the value of thebackwardrecord component.children()Direct child plans, left-to-right; empty for aPhysicalNode.Scan.TheOrderingthat this node delivers on its output stream.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleaninner()Returns the value of theinnerrecord component.left()Returns the value of theleftrecord component.intReturns the value of theleftMatchIndexrecord component.Returns the value of thepartitionKeysrecord component.right()Returns the value of therightrecord component.intReturns the value of therightMatchIndexrecord component.schema()Returns the value of theschemarecord component.booleanstrict()Returns the value of thestrictrecord component.tieBreak()Returns the value of thetieBreakrecord component.Returns the value of thetolerancerecord 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
-
AsOfJoin
public AsOfJoin(Schema schema, PhysicalNode.JoinKeys partitionKeys, int leftMatchIndex, int rightMatchIndex, boolean backward, boolean strict, PhysicalNode left, PhysicalNode right) Convenience constructor preserving backward compatibility (no tolerance, left-outer, LAST). -
AsOfJoin
public AsOfJoin(Schema schema, PhysicalNode.JoinKeys partitionKeys, int leftMatchIndex, int rightMatchIndex, boolean backward, boolean strict, Optional<Duration> tolerance, boolean inner, TieBreak tieBreak, PhysicalNode left, PhysicalNode right) Creates an instance of aAsOfJoinrecord class.- Parameters:
schema- the value for theschemarecord componentpartitionKeys- the value for thepartitionKeysrecord componentleftMatchIndex- the value for theleftMatchIndexrecord componentrightMatchIndex- the value for therightMatchIndexrecord componentbackward- the value for thebackwardrecord componentstrict- the value for thestrictrecord componenttolerance- the value for thetolerancerecord componentinner- the value for theinnerrecord componenttieBreak- the value for thetieBreakrecord 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
Description copied from interface:PhysicalNodeTheOrderingthat this node delivers on its output stream. The default implementation returnsOrdering.none()— meaning no guaranteed row order — which is the conservative safe answer for any operator that does not propagate or establish an ordering. Individual nodes that do preserve order (PhysicalNode.Select,PhysicalNode.Limit) or establish it (PhysicalNode.Sort) override this method.- 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
schema
Returns the value of theschemarecord component.- Specified by:
schemain interfacePhysicalNode- Returns:
- the value of the
schemarecord component
-
partitionKeys
Returns the value of thepartitionKeysrecord component.- Returns:
- the value of the
partitionKeysrecord component
-
leftMatchIndex
public int leftMatchIndex()Returns the value of theleftMatchIndexrecord component.- Returns:
- the value of the
leftMatchIndexrecord component
-
rightMatchIndex
public int rightMatchIndex()Returns the value of therightMatchIndexrecord component.- Returns:
- the value of the
rightMatchIndexrecord component
-
backward
public boolean backward()Returns the value of thebackwardrecord component.- Returns:
- the value of the
backwardrecord component
-
strict
public boolean strict()Returns the value of thestrictrecord component.- Returns:
- the value of the
strictrecord component
-
tolerance
Returns the value of thetolerancerecord component.- Returns:
- the value of the
tolerancerecord component
-
inner
public boolean inner()Returns the value of theinnerrecord component.- Returns:
- the value of the
innerrecord component
-
tieBreak
Returns the value of thetieBreakrecord component.- Returns:
- the value of the
tieBreakrecord 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
-