Monash University · FACULTY OF INFORMATION TECHNOLOGY

FIT5202 · Data Processing for Big Data

- one subject, every graph, every model, every mark
Information Technology14 Chapters6-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 10 of 11 · FIT5202

Stream Join Processing

Week 10 of Monash FIT5202 covers joining data streams: the symmetric hash join (SHJ) for two streams, the M-join for multiple streams, and windowed stream–stream joins where unbounded state must be bounded. It introduces the time-slide method over basic windows and, in Structured Streaming, watermarks for handling late data. Tracing a symmetric-hash-join arrival sequence is a common written-response item and the intuition behind windowed joins is examinable.

In this chapter

What this chapter covers

  • 01Stream–static vs stream–stream joins; why unbounded state must be bounded
  • 02Symmetric Hash Join (SHJ): each stream keeps its own hash table
  • 03SHJ arrival handling: probe the other table, then insert into your own
  • 04M-Join for multiple streams: remove expired tuples, probe all other tables, hash into your own
  • 05Time-based window stream joins (tuple slide, time slide)
  • 06Time-slide over basic windows (e.g. 1 basic window = 1 minute; window = 6; slide = 2)
  • 07Watermarks and late-data handling in Structured Streaming
  • 08Why symmetric tables ensure no incoming tuple's join is missed
Worked example · free

Tracing a symmetric hash join over two streams

Q [5 marks]. Two streams are joined on orderID with a Symmetric Hash Join: stream R (orders) and stream S (payments), each with its own hash table (HT_R, HT_S). Trace the emitted join results as tuples arrive in this order: r(1), r(2), s(1), s(3), r(3). (5 marks)
  • +1r(1) arrives on R: probe HT_S (empty) → no match; then insert r(1) into HT_R. HT_R = {1}.
  • +1r(2) arrives on R: probe HT_S (still empty) → no match; insert r(2) into HT_R. HT_R = {1, 2}.
  • +1s(1) arrives on S: probe HT_R → finds r(1) → EMIT join result orderID 1; then insert s(1) into HT_S. HT_S = {1}.
  • +1s(3) arrives on S: probe HT_R = {1, 2} → no match for 3; insert s(3) into HT_S. HT_S = {1, 3}.
  • +1r(3) arrives on R: probe HT_S = {1, 3} → finds s(3) → EMIT join result orderID 3; insert r(3) into HT_R. Final emitted results: orderID 1 and orderID 3.
The join emits orderID 1 (when s(1) arrives and matches the stored r(1)) and orderID 3 (when r(3) arrives and matches the stored s(3)). No match is missed regardless of which stream's tuple arrives first, because each stream keeps its own hash table.
Sia tip — The SHJ rule for every arrival is fixed: probe the OTHER stream's table first (to emit any matches), then insert into your OWN table. Keeping two symmetric tables is exactly what lets a late partner still match — the earlier tuple is already stored, waiting to be probed.
Glossary

Key terms

Stream–stream join
A join of two continuous streams where matching tuples may arrive at different times, so both sides must be buffered (within a window) until their partner arrives.
Symmetric Hash Join (SHJ)
A stream join in which each stream has its own hash table. When a tuple arrives, it probes the other stream's table to emit matches, then inserts itself into its own table, so no join is missed by arrival order.
M-Join
A multiway streaming join: each stream has a hash table; an arriving tuple first removes expired tuples, probes all other streams' tables, then hashes into its own table.
Windowed join
A stream join restricted to a time window so the state (buffered tuples) stays bounded; tuples outside the window expire and are discarded.
Time-slide
A windowing method that decomposes a big window into basic windows (e.g. one per minute) and advances the big window by one or more basic windows at a time.
Watermark
A moving threshold on event time in Structured Streaming that declares how late data may be; state older than the watermark can be dropped, bounding memory while tolerating some late arrivals.
FAQ

Stream Join Processing FAQ

Why does a stream join need a hash table on each side?

Because tuples that should join can arrive at different times and in either order. If only one stream were hashed, a tuple arriving on the other stream before its partner would be lost. Keeping a symmetric hash table on each stream means whichever tuple arrives first is stored, ready to be probed and matched when its partner arrives.

Why must stream joins be windowed?

Because the streams are unbounded, so without a limit the hash tables would grow forever and eventually exhaust memory. A window (with expiry or a watermark) bounds how long tuples are kept, trading the ability to match very-late partners for bounded, sustainable state.

What is the rule for handling each arriving tuple in a symmetric hash join?

Probe first, insert second: when a tuple arrives, probe the OTHER stream's hash table to emit any matches, then insert the tuple into its OWN hash table (and, in M-join, first expire old tuples). Following that order for every arrival is what guarantees completeness within the window.

Can AI help me trace stream joins?

Yes. Sia can walk a symmetric-hash-join or M-join arrival sequence step by step, explain windowed joins and watermarks, and quiz you on why symmetric tables prevent missed matches. It explains the method and checks your reasoning; it does not complete graded work, and Monash academic-integrity rules apply.

Study strategy

Exam move

Practise the symmetric-hash-join trace until the probe-then-insert rule is automatic, and be able to state, for any arrival order, which results are emitted and when. Understand why windowing (and watermarks) bound the otherwise-unbounded state, and be able to contrast SHJ with the multiway M-join. This is classic Q2–Q6 written-response material, so rehearse a full arrival trace on Moodle problems through SWOTVAC and ask Sia to generate fresh arrival sequences to solve.

Working through Stream Join Processing in FIT5202? Sia is AskSia’s AI Information Technology tutor — ask any FIT5202 Stream Join Processing question and get a clear, step-by-step explanation grounded in how FIT5202 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 47 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your FIT5202 tutor, unlimited, worked the way the exam marks it
The full 6-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$25/ month
30-day money-back · cancel in one tap · how it works
Unlock the full FIT5202 Bible + 47 Monash University subjects解锁完整 FIT5202 Bible + Monash University 47 门科目
$25/mo