- Record Components:
input- the edge relation; must not be nullfromColumn- the first edge-endpoint column; also names the output node column; must not be blanktoColumn- the second edge-endpoint column; must not be blanklabelColumn- the name of the appended component-label column; must not be blanklocation- the source location of this node; never null
- All Implemented Interfaces:
RelNode
The input() relation is read as a set of undirected edges
over two columns, fromColumn() and toColumn() (the edge is
treated symmetrically — from ↔ to). The operator partitions the graph's
nodes into maximal connected components and emits one row per distinct node,
carrying the node together with the id of the component it belongs to. The
result is therefore the relational equivalent of an undirected
union-find / connected-components pass — what otherwise requires a hand-rolled
recursive self-join.
Output is a binary relation: the node-identifier column (keeping the
fromColumn() name and type) and the component-label column
(labelColumn(), type NUMBER). Component labels are
canonical: each component is identified by a dense, 1-based integer
assigned in ascending order of the component's minimum node id, so a given
graph always produces the same labels regardless of input row order.
Evaluation is an in-engine union-find over the whole edge set — a blocking operator (it must see every edge before any node can be labelled), so it never pushes down to a source and is subject to the boundedness check over unbounded inputs.
Surface syntax: CLUSTER from, to AS label (Edges).
-
Constructor Summary
ConstructorsConstructorDescriptionClusterNode(RelNode input, String fromColumn, String toColumn, String labelColumn) Convenience constructor for tests:SourceLocation.UNKNOWN.ClusterNode(RelNode input, String fromColumn, String toColumn, String labelColumn, SourceLocation location) Creates an instance of aClusterNoderecord class. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(RelNodeVisitor<R> visitor) final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefromColumnrecord component.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.Returns the value of thelabelColumnrecord component.location()Returns the value of thelocationrecord component.toColumn()Returns the value of thetoColumnrecord 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
-
Constructor Details
-
ClusterNode
public ClusterNode(RelNode input, String fromColumn, String toColumn, String labelColumn, SourceLocation location) Creates an instance of aClusterNoderecord class.- Parameters:
input- the value for theinputrecord componentfromColumn- the value for thefromColumnrecord componenttoColumn- the value for thetoColumnrecord componentlabelColumn- the value for thelabelColumnrecord componentlocation- the value for thelocationrecord component
-
ClusterNode
Convenience constructor for tests:SourceLocation.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). -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
fromColumn
Returns the value of thefromColumnrecord component.- Returns:
- the value of the
fromColumnrecord component
-
toColumn
Returns the value of thetoColumnrecord component.- Returns:
- the value of the
toColumnrecord component
-
labelColumn
Returns the value of thelabelColumnrecord component.- Returns:
- the value of the
labelColumnrecord component
-
location
Returns the value of thelocationrecord component.
-