Record Class PairwiseUniversalNode

java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.PairwiseUniversalNode
Record Components:
left - the left input relation; must not be null
right - the right input relation; must not be null
condition - the join predicate; must not be null
location - the source location of this node; never null
All Implemented Interfaces:
ConditionalJoinNode, RelNode

public record PairwiseUniversalNode(RelNode left, RelNode right, Predicate condition, SourceLocation location) extends Record implements ConditionalJoinNode
Represents a pairwise universal semi-join (USEMI), the ∀ dual of semi-join (⋉).

Keeps left rows ℓ such that ∀ r ∈ R : θ(ℓ, r) — i.e., every row in the right relation satisfies the condition when paired with the left row. If the right relation is empty, all left rows pass (vacuously true).

Strict NULL semantics: a predicate that evaluates to UNKNOWN counts as not satisfied, so any UNKNOWN match disqualifies the left row. This matches the NOT EXISTS (… WHERE NOT θ) reading.

The output schema equals the left input schema (right columns are never in the output), mirroring semi-join and anti-join.

  • Constructor Details

    • PairwiseUniversalNode

      public PairwiseUniversalNode(RelNode left, RelNode right, Predicate condition, SourceLocation location)
      Creates an instance of a PairwiseUniversalNode record class.
      Parameters:
      left - the value for the left record component
      right - the value for the right record component
      condition - the value for the condition record component
      location - the value for the location record component
    • PairwiseUniversalNode

      public PairwiseUniversalNode(RelNode left, RelNode right, Predicate condition)
      Convenience constructor for tests; uses SourceLocation.UNKNOWN.
  • Method Details

    • rebuild

      public PairwiseUniversalNode rebuild(RelNode left, RelNode right, Predicate condition)
      Description copied from interface: ConditionalJoinNode
      Reconstructs this node with new inputs and/or condition, preserving the concrete join type and this node's RelNode.location().
      Specified by:
      rebuild in interface ConditionalJoinNode
      Parameters:
      left - the new left input; must not be null
      right - the new right input; must not be null
      condition - the new join predicate; must not be null
      Returns:
      a node of the same concrete type; never null
    • accept

      public <R> R accept(RelNodeVisitor<R> visitor)
      Specified by:
      accept in interface RelNode
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • left

      public RelNode left()
      Returns the value of the left record component.
      Specified by:
      left in interface ConditionalJoinNode
      Returns:
      the value of the left record component
    • right

      public RelNode right()
      Returns the value of the right record component.
      Specified by:
      right in interface ConditionalJoinNode
      Returns:
      the value of the right record component
    • condition

      public Predicate condition()
      Returns the value of the condition record component.
      Specified by:
      condition in interface ConditionalJoinNode
      Returns:
      the value of the condition record component
    • location

      public SourceLocation location()
      Returns the value of the location record component.
      Specified by:
      location in interface RelNode
      Returns:
      the value of the location record component