Spark Streaming Flashcards
6 cards from real Apache Spark practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Spark Streaming flashcards as text
What is a sliding window in Spark Structured Streaming?
Answer: A window that moves forward by a fixed step smaller than the window duration, causing overlaps
A sliding window has a duration and a slide interval; if the slide is smaller than the window duration, windows overlap.
Which method starts a streaming query in Spark Structured Streaming?
Answer: df.writeStream.start()
writeStream configures the output sink and options, and start() launches the streaming query, returning a StreamingQuery object.
What is the Update output mode in Spark Structured Streaming?
Answer: Writes only rows that were updated or newly added since the last trigger
Update mode writes only the rows in the result table that were changed (inserted or updated) since the last trigger.
Which method waits for a streaming query to finish in Spark?
Answer: query.awaitTermination()
awaitTermination() blocks the driver program until the streaming query is stopped or encounters an error.
What is the role of offsets in Spark Structured Streaming with Kafka?
Answer: They track the position in the Kafka topic for fault-tolerant exactly-once processing
Offsets track the last-read position in Kafka topics, stored in checkpoints, enabling the stream to resume from where it stopped.
In Spark Structured Streaming, which trigger processes all available data in a single batch and then stops?
Answer: Trigger.Once()
Trigger.Once() processes all available data in a single micro-batch and then terminates the query.