- Record Components:
kind- which rows an unmatched side keeps; never nullleft- the left input relation; never nullright- the right input relation; never nullcolumns- the shared columns to match on; at least one, no name twicelocation- the source location of this node; never null
- All Implemented Interfaces:
RelNode
JOIN … USING (a, b) — in its inner,
left, right and full forms.
Rows match where every named column is equal on both sides, as an equality
condition on each would have it, so a NULL matches nothing. The output carries each
named column once, first and in the order named: the left row's value for an inner
or left join, the right row's for a right join, and whichever side is present for a
full join, as SQL's COALESCE of the two. Then come the left input's other
columns and the right input's other columns, a right column whose name the left
already uses taking the _r suffix every join gives it.
Unlike the natural join, which matches on every column the two inputs share, only the named columns are matched; any other shared column stays twice.
Example: Orders ⟕ USING (customer_id) Customers, or in SQL's order,
Orders LJOIN Customers USING (customer_id).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich unmatched rows the join keeps, as SQL's[INNER | LEFT | RIGHT | FULL] JOIN. -
Constructor Summary
ConstructorsConstructorDescriptionUsingJoinNode(UsingJoinNode.Kind kind, RelNode left, RelNode right, List<String> columns) Convenience constructor for tests; usesSourceLocation.UNKNOWN.UsingJoinNode(UsingJoinNode.Kind kind, RelNode left, RelNode right, List<String> columns, SourceLocation location) Creates an instance of aUsingJoinNoderecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(RelNodeVisitor<R> visitor) columns()Returns the value of thecolumnsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.left()Returns the value of theleftrecord component.location()Returns the value of thelocationrecord component.right()Returns the value of therightrecord 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.ast.RelNode
children, mapChildren, materializationMode, prettyPrint, prettyPrint
-
Constructor Details
-
UsingJoinNode
public UsingJoinNode(UsingJoinNode.Kind kind, RelNode left, RelNode right, List<String> columns, SourceLocation location) Creates an instance of aUsingJoinNoderecord class. -
UsingJoinNode
Convenience constructor for tests; usesSourceLocation.UNKNOWN.
-
-
Method Details
-
accept
-
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). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord 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
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
location
Returns the value of thelocationrecord component.
-