A. Missing checkpoint location for streaming query
B. Using 'csv' format with readStream is invalid for streaming
C. Calling awaitTermination() is not allowed
D. The format 'console' is not supported for writeStream
Solution
Step 1: Check streaming source format
CSV format can be used with readStream if the source directory receives new files continuously.
Step 2: Verify streaming sink requirements
Streaming queries writing to sinks like console usually require a checkpoint location to track progress and recover from failures.
Final Answer:
Missing checkpoint location for streaming query -> Option A
Quick Check:
Streaming needs checkpoint location [OK]
Hint: Always set checkpoint location for streaming queries [OK]
Common Mistakes:
Assuming CSV cannot be streaming source
Ignoring checkpoint location requirement
Thinking awaitTermination() is disallowed
5. You want to build a live dashboard that updates every second with the count of events from a Kafka stream using Apache Spark Structured Streaming. Which approach best enables real-time analytics?
hard
A. Use batch processing to read Kafka data every minute and update dashboard
B. Use Spark Structured Streaming to read Kafka continuously and update dashboard every second
C. Manually download Kafka data and process offline
D. Use static DataFrame to read Kafka data once and refresh dashboard manually
Solution
Step 1: Understand real-time dashboard needs
A live dashboard requires continuous, frequent updates with fresh data.
Step 2: Match streaming approach to dashboard
Spark Structured Streaming can read Kafka data continuously and update results every second, enabling real-time analytics.
Step 3: Evaluate other options
Batch processing or static reads cause delays and do not provide real-time updates.
Final Answer:
Use Spark Structured Streaming to read Kafka continuously and update dashboard every second -> Option B
Quick Check:
Continuous streaming = real-time updates [OK]
Hint: Continuous streaming enables live dashboards [OK]
Common Mistakes:
Using batch instead of streaming for live data
Thinking static DataFrame can update live
Downloading data manually for real-time needs
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.