Stream joins
A stream-stream join correlates two event streams by key inside a bounded time interval. ArkFlow implements it as a keyed interval join operator in the Job DAG: two inputs, one key per side, and an event-time distance bound.
The join is not a lookup join. Both sides are streams; state is kept per key only for as long as the interval and TTL require, and matches emit as soon as the second side arrives.
Shape of the operator
A join operator declares exactly two inbound edges and names its sides by
upstream operator id (left_from / right_from), not by channel order. The
configuration carries:
| Field | Meaning |
|---|---|
left_from, right_from | Upstream operator ids of the two sides. |
left_key, right_key | Equality keys on each side. |
window_ms | Maximum allowed difference between the two event timestamps. |
left_timestamp, right_timestamp | Timestamp columns; default __meta_timestamp. |
ttl_ms | How long a row stays joinable after its interval expires. |
max_per_key | Per-side row cap for one key (bounds skew). |
join_type | inner (default), left_outer, right_outer, full_outer. |
Semantics
- Match rule. Keys are equal and the event timestamps differ by at most
window_ms. Matches emit immediately, regardless ofjoin_type. - Event-time bounds. A row is evicted once the chain watermark passes
timestamp + window_ms + ttl_ms. The chain watermark is the minimum across both sides, so one side cannot advance past the other's unprocessed history. - Output shape. Left columns are prefixed
l_, right columnsr_, plus ajoin_keycolumn. With an outer join type the side that can be null for unmatched rows becomes nullable in the schema. - Outer rows. With
left_outer,right_outer, orfull_outer, a never-matched row is emitted once the watermark passestimestamp + window_ms + ttl_ms, with the opposite side all null. A row that matched at least once never re-emits as unmatched. The opposite side's schema is required: until that side produces a batch, evicted rows park in a bounded queue (max_per_key, oldest dropped) and flush when the schema arrives. Processing-time sources without watermarks never emit unmatched rows. - Bounded state. Each key holds at most
max_per_keyrows per side; the oldest are evicted first. Under an outer join, capacity eviction also emits the evicted row as unmatched — without a watermark guarantee, so a later match can double-emit. Capacity evictions log a throttledwarnwith side, key, buffer depth, and the suppressed count.
Replay and recovery
Join buffers are not a separate snapshot. Recovery rebuilds them, including per-row matched flags, from checkpoint replay; source positions are restored before any input is read, so replay cannot produce a false unmatched row beyond the documented late-data contract. Matches are at-least-once: downstream must tolerate duplicates after recovery.
Constraints
- Each side's schema must stay stable for the stream's lifetime.
- Each side's upstream operator must feed the join from a single subtask; a multi-subtask side fails at graph build time with guidance to set the upstream parallelism to 1.
- The join and both upstream edges stay co-located on one node. Cross-node shuffle joins are not supported.
- Temporal (lookup) joins, non-equi joins, and arbitrary interval conditions are
not supported. Use the
lookupprocessor for enrichment from a database or the SQLJOINfor batch-local joins.
Configure it
The operator configuration and a complete runnable YAML are in Stream-stream join. For the watermark mechanics that decide when outer rows emit, read Event time and watermarks.
Related pages
- Event time and watermarks
- Distributed Jobs — placement and checkpoint recovery.
- Delivery and durability — replay semantics for join output.
- Lookup processor — enrichment instead of a temporal join.