Package com.darkcollective.relix.plan
Record Class PhysicalNode.SimilarityJoin
java.lang.Object
java.lang.Record
com.darkcollective.relix.plan.PhysicalNode.SimilarityJoin
- Record Components:
condition- the join's whole condition, which confirms each pairbuildSide- the input that is indexedleftRelations- relation names reachable on the left siderightRelations- relation names reachable on the right sidefunction- the name of the function whose call the condition boundsleftColumn- the column of the left input passed to the callrightColumn- the column of the right input passed to the callbound- how the call's result is compared withthreshold, with the call read on the leftthreshold- the constant the result is compared with
- All Implemented Interfaces:
PhysicalNode
- Enclosing interface:
PhysicalNode
public static record PhysicalNode.SimilarityJoin(Schema schema, Predicate condition, PhysicalNode.BuildSide buildSide, Set<String> leftRelations, Set<String> rightRelations, String function, int leftColumn, int rightColumn, Blocking.Bound bound, BigDecimal threshold, PhysicalNode left, PhysicalNode right)
extends Record
implements PhysicalNode
Similarity join — an inner theta join whose condition bounds a two-argument
function's result by a constant,
F(left.x, right.y) >= t, executed by
indexing one input under the keys the function's
Blocking gives and probing it with the
other, rather than calling F on every pair.
It is the nested-loop PhysicalNode.Join it replaces — join() rebuilds it —
plus what the index needs. The join's whole condition confirms every candidate
pair, so the blocking only ever removes pairs that could not pass, and its build
side is the input that is indexed. An executor that cannot obtain the blocking — a
function catalogue without the function — runs join() instead, and answers
the same.
-
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.Roll, PhysicalNode.Scan, PhysicalNode.Select, PhysicalNode.Sessionize, PhysicalNode.SetKind, PhysicalNode.SetOp, PhysicalNode.Shuffle, PhysicalNode.SimilarityJoin, PhysicalNode.Solve, PhysicalNode.Sort, PhysicalNode.Spool, PhysicalNode.TopK, PhysicalNode.Trace, PhysicalNode.Tree, PhysicalNode.Universal, PhysicalNode.Unnest, PhysicalNode.Unpivot, PhysicalNode.Why, PhysicalNode.Window -
Constructor Summary
ConstructorsConstructorDescriptionSimilarityJoin(Schema schema, Predicate condition, PhysicalNode.BuildSide buildSide, Set<String> leftRelations, Set<String> rightRelations, String function, int leftColumn, int rightColumn, Blocking.Bound bound, BigDecimal threshold, PhysicalNode left, PhysicalNode right) Creates an instance of aSimilarityJoinrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbound()Returns the value of theboundrecord component.Returns the value of thebuildSiderecord component.children()Direct child plans, left-to-right; empty for aPhysicalNode.Scan.Returns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.function()Returns the value of thefunctionrecord component.final inthashCode()Returns a hash code value for this object.join()The nested-loop inner join this replaces, over the same inputs.left()Returns the value of theleftrecord component.intReturns the value of theleftColumnrecord component.Returns the value of theleftRelationsrecord component.static PhysicalNode.SimilarityJoinof(PhysicalNode.Join join, String function, int leftColumn, int rightColumn, Blocking.Bound bound, BigDecimal threshold) The similarity join that replaces a nested-loop inner join.right()Returns the value of therightrecord component.intReturns the value of therightColumnrecord component.Returns the value of therightRelationsrecord component.schema()Returns the value of theschemarecord component.Returns the value of thethresholdrecord 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
deliveredOrdering, mapChildren
-
Constructor Details
-
SimilarityJoin
public SimilarityJoin(Schema schema, Predicate condition, PhysicalNode.BuildSide buildSide, Set<String> leftRelations, Set<String> rightRelations, String function, int leftColumn, int rightColumn, Blocking.Bound bound, BigDecimal threshold, PhysicalNode left, PhysicalNode right) Creates an instance of aSimilarityJoinrecord class.- Parameters:
schema- the value for theschemarecord componentcondition- the value for theconditionrecord componentbuildSide- the value for thebuildSiderecord componentleftRelations- the value for theleftRelationsrecord componentrightRelations- the value for therightRelationsrecord componentfunction- the value for thefunctionrecord componentleftColumn- the value for theleftColumnrecord componentrightColumn- the value for therightColumnrecord componentbound- the value for theboundrecord componentthreshold- the value for thethresholdrecord componentleft- the value for theleftrecord componentright- the value for therightrecord component
-
-
Method Details
-
of
public static PhysicalNode.SimilarityJoin of(PhysicalNode.Join join, String function, int leftColumn, int rightColumn, Blocking.Bound bound, BigDecimal threshold) The similarity join that replaces a nested-loop inner join.- Parameters:
join- the join, whose condition, build side and inputs it keeps- Returns:
- the similarity join
- Throws:
IllegalArgumentException- ifjoinhas no condition
-
join
The nested-loop inner join this replaces, over the same inputs. -
children
Description copied from interface:PhysicalNodeDirect child plans, left-to-right; empty for aPhysicalNode.Scan.- Specified by:
childrenin interfacePhysicalNode
-
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
-
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
buildSide
Returns the value of thebuildSiderecord component.- Returns:
- the value of the
buildSiderecord 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
-
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-
leftColumn
public int leftColumn()Returns the value of theleftColumnrecord component.- Returns:
- the value of the
leftColumnrecord component
-
rightColumn
public int rightColumn()Returns the value of therightColumnrecord component.- Returns:
- the value of the
rightColumnrecord component
-
bound
Returns the value of theboundrecord component.- Returns:
- the value of the
boundrecord component
-
threshold
Returns the value of thethresholdrecord component.- Returns:
- the value of the
thresholdrecord 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
-