Spark's engine for near real-time data: you write a batch-like query and it processes new data incrementally, recording progress in a checkpoint with exactly-once guarantees. Auto Loader and streaming tables run on it.
Also called Apache Spark Structured Streaming.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains Structured Streaming in context, with comparison tables and the common traps.
Terms in this definition
- Checkpoint
The storage location in which a streaming query records its offsets, state, commits and ID. Thanks to it, a restarted query picks up precisely where it left off. Never point two queries at the same one.
- Auto Loader
The
cloudFilesStructured Streaming source, which picks up new files from cloud storage or volumes as they arrive. Its checkpoint records progress so each file is processed exactly once, and it can infer and evolve the schema. - Streaming
Sending model output piece by piece as server-sent events. Only the delivery changes; the answer's content, completeness and cost stay the same.
Related terms
- Asynchronous progress tracking
Keeps processing moving in Structured Streaming while offset and commit log writes happen asynchronously. A query fails if it combines this with an
AvailableNoworOncetrigger. - DataFrame
Spark's rows-and-columns structure for data. In Structured Streaming it grows continually as each event adds rows, and queries run against it.
- foreachBatch
A Structured Streaming output option, called through
writeStream.foreachBatch, that hands every micro-batch to your own batch code, which suitsMERGEupserts and destinations lacking a streaming writer. Delivery is at least once, so the code should be safe to repeat. - Incremental batch
An approach that runs Structured Streaming with the
availableNowtrigger: it picks up only records added since the previous run and then shuts down, giving scheduled jobs streaming-style progress tracking for the cost of a batch. - Kafka
Apache Kafka is a distributed system for passing messages, and Structured Streaming can use it as both source and sink. Writes to it are delivered at least once, so anything reading the topic needs to remove duplicates.
- Kinesis
Amazon's streaming message service, which Structured Streaming can read from. Databricks advises using a Unity Catalog connection of type
KINESISfor authentication on Runtime 19 and later. - Native execution engine
A vectorised engine written in C++, based on Velox and Apache Gluten, that speeds up Fabric Spark by running supported operators natively, notably for Parquet, Delta and CSV. Anything it can't handle, such as JSON, XML or structured streaming, goes back to the JVM engine; you switch it on with spark.native.enabled.
- Output mode
Decides which rows a stateful Structured Streaming query writes out at each trigger: append, the default, for finalised rows only; update for rows that changed, which Delta sinks don't support; or complete for the entire result.