QuestionQ223

VerifiedStructured Streaming

A data engineer is building a real-time analytics pipeline with Apache Spark Structured Streaming. The engineer needs to process incoming data and ensure that triggers determine when the query runs. The system must process data in micro-batches at a fixed 5-second interval.

Which code snippet could the data engineer use to meet this requirement?

Explanation

A processingTime trigger with the string interval "5 seconds" schedules a Structured Streaming micro-batch query to run periodically every five seconds. A continuous trigger selects continuous processing rather than the required micro-batch execution mode.

Learn more

Community Discussion

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