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 pair
buildSide - the input that is indexed
leftRelations - relation names reachable on the left side
rightRelations - relation names reachable on the right side
function - the name of the function whose call the condition bounds
leftColumn - the column of the left input passed to the call
rightColumn - the column of the right input passed to the call
bound - how the call's result is compared with threshold, with the call read on the left
threshold - 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.

  • 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 a SimilarityJoin record class.
      Parameters:
      schema - the value for the schema record component
      condition - the value for the condition record component
      buildSide - the value for the buildSide record component
      leftRelations - the value for the leftRelations record component
      rightRelations - the value for the rightRelations record component
      function - the value for the function record component
      leftColumn - the value for the leftColumn record component
      rightColumn - the value for the rightColumn record component
      bound - the value for the bound record component
      threshold - the value for the threshold record component
      left - the value for the left record component
      right - the value for the right record 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 - if join has no condition
    • join

      public PhysicalNode.Join join()
      The nested-loop inner join this replaces, over the same inputs.
    • children

      public List<PhysicalNode> children()
      Description copied from interface: PhysicalNode
      Direct child plans, left-to-right; empty for a PhysicalNode.Scan.
      Specified by:
      children in interface PhysicalNode
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • schema

      public Schema schema()
      Returns the value of the schema record component.
      Specified by:
      schema in interface PhysicalNode
      Returns:
      the value of the schema record component
    • condition

      public Predicate condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component
    • buildSide

      public PhysicalNode.BuildSide buildSide()
      Returns the value of the buildSide record component.
      Returns:
      the value of the buildSide record component
    • leftRelations

      public Set<String> leftRelations()
      Returns the value of the leftRelations record component.
      Returns:
      the value of the leftRelations record component
    • rightRelations

      public Set<String> rightRelations()
      Returns the value of the rightRelations record component.
      Returns:
      the value of the rightRelations record component
    • function

      public String function()
      Returns the value of the function record component.
      Returns:
      the value of the function record component
    • leftColumn

      public int leftColumn()
      Returns the value of the leftColumn record component.
      Returns:
      the value of the leftColumn record component
    • rightColumn

      public int rightColumn()
      Returns the value of the rightColumn record component.
      Returns:
      the value of the rightColumn record component
    • bound

      public Blocking.Bound bound()
      Returns the value of the bound record component.
      Returns:
      the value of the bound record component
    • threshold

      public BigDecimal threshold()
      Returns the value of the threshold record component.
      Returns:
      the value of the threshold record component
    • left

      public PhysicalNode left()
      Returns the value of the left record component.
      Returns:
      the value of the left record component
    • right

      public PhysicalNode right()
      Returns the value of the right record component.
      Returns:
      the value of the right record component