Record Class ColumnarJoin
java.lang.Object
java.lang.Record
io.krabka.streams.columnar.ColumnarJoin
- Record Components:
leftKey- the join key column in the left branch's batchesrightKey- the join key column in the right branch's batcheswindow- the maximum event-time distance between matching rows; zero joins only equal timestampsleftPrefix- the prefix for left payload columns in the joined batchrightPrefix- the prefix for right payload columns in the joined batch
public record ColumnarJoin(String leftKey, String rightKey, Duration window, String leftPrefix, String rightPrefix)
extends Record
Configuration for an inner, event-time, equi-join.
Passed to ColumnarTopology.addJoin(String, ColumnarJoin, ColumnarNode, ColumnarNode).
Two rows match when their key column values are equal and their __timestamp
values differ by at most the window. The joined batch carries the left and right
payload columns renamed with the prefixes, followed by the metadata columns of the
left row.
Example
var join = new ColumnarJoin("order_id", "order_id", Duration.ofMinutes(5));
var joined = topology.addJoin("orders-with-payments", join, orders, payments);
-
Constructor Summary
ConstructorsConstructorDescriptionColumnarJoin(String leftKey, String rightKey, Duration window) Creates a join with the defaultleft_andright_prefixes.ColumnarJoin(String leftKey, String rightKey, Duration window, String leftPrefix, String rightPrefix) Validates the configuration. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.leftKey()Returns the value of theleftKeyrecord component.Returns the value of theleftPrefixrecord component.rightKey()Returns the value of therightKeyrecord component.Returns the value of therightPrefixrecord component.final StringtoString()Returns a string representation of this record class.window()Returns the value of thewindowrecord component.
-
Constructor Details
-
ColumnarJoin
Creates a join with the defaultleft_andright_prefixes.- Parameters:
leftKey- the join key column in the left branch's batchesrightKey- the join key column in the right branch's batcheswindow- the maximum event-time distance between matching rows
-
ColumnarJoin
public ColumnarJoin(String leftKey, String rightKey, Duration window, String leftPrefix, String rightPrefix) Validates the configuration.- Parameters:
leftKey- the join key column in the left branch's batchesrightKey- the join key column in the right branch's batcheswindow- the maximum event-time distance between matching rowsleftPrefix- the prefix for left payload columns in the joined batchrightPrefix- the prefix for right payload columns in the joined batch- Throws:
NullPointerException- if any component is nullIllegalArgumentException- if the window is negative or below one millisecond of precision
-
-
Method Details
-
toString
-
hashCode
-
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). -
leftKey
-
rightKey
-
window
-
leftPrefix
Returns the value of theleftPrefixrecord component.- Returns:
- the value of the
leftPrefixrecord component
-
rightPrefix
Returns the value of therightPrefixrecord component.- Returns:
- the value of the
rightPrefixrecord component
-