QuestionQ229

VerifiedStructured Streaming

A data engineer is developing an Apache Spark™ Structured Streaming application to process a real-time stream of JSON events. The engineer wants the application to be fault-tolerant and, if a failure occurs, resume processing from the last successfully processed record. To accomplish this, the data engineer chooses to implement checkpoints.

Which code snippet should the data engineer use?

Explanation

Structured Streaming persists source offsets and query state at the checkpointLocation, allowing a restarted query to recover progress after a failure. The DataStreamWriter option is named checkpointLocation; append mode writes newly arrived rows for a non-aggregated event stream.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!