Databricks-Spark-Assoc Structured Streaming Practice Question
You are performing a stream-stream join between two streaming DataFrames, `orders` and `payments`, both with watermarks defined on their event time columns. The join condition is `orders.orderId == payments.orderId` and it is an inner join. What happens to state in this join?
⚠ Common exam trap
The trap here is assuming that one stream is the driver and only its state is kept, but stream-stream joins require state on both sides.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
State is maintained for both streams and is cleaned up based on the watermarks.
In a stream-stream inner join, the engine maintains state for both streams to match records across micro-batches. Watermarks define when state can be evicted: once the watermark passes the event time of a record plus the allowed lateness, its state is removed. This ensures that late-arriving matches within the watermark window are still processed.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
State is maintained only for the right stream, as it is the stream being joined to.
Why it's wrong here
Similar to the left stream, the right stream also requires state. The join is symmetric, and the engine buffers records from both streams to perform the join. There is no inherent asymmetry that would cause state to be kept for only one side.
- ✗
State is not maintained; the join is stateless and relies on the current micro-batch.
Why it's wrong here
Stream-stream joins are inherently stateful because records from one stream may arrive in different micro-batches than matching records from the other stream. The engine must buffer unmatched records as state until a match is found or the watermark expires. A stateless join would not be able to correlate events across batches.
- ✗
State is maintained only for the left stream, as it is the driving stream.
Why it's wrong here
In a stream-stream join, both streams are symmetric; the engine does not treat one as the driving stream. State is maintained for both sides to facilitate matching. The concept of a driving stream is not applicable here; both sides contribute to the join and require state.
- ✓
State is maintained for both streams and is cleaned up based on the watermarks.
Why this is correct
In a stream-stream join, the engine maintains state for both sides to match records. Watermarks are used to determine when state can be evicted. For an inner join, state for a record is kept until the watermark passes the record's event time plus the watermark delay, ensuring that late matches can still occur within the allowed lateness.
About these practice questions
This Databricks-Spark-Assoc question is part of Courseiva's 295-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-Spark-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-Spark-Assoc exam.