databricks-spark-structured-streaming

Build production Spark Structured Streaming pipelines with Kafka ingestion and Delta writes.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/aaronachermann/PolentaEncoders --skill databricks-spark-structured-streaming-aaronachermann
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-spark-structured-streaming
Source: https://github.com/aaronachermann/PolentaEncoders/tree/main/.github/skills/databricks-spark-structured-streaming
Command: npx skills add https://github.com/aaronachermann/PolentaEncoders --skill databricks-spark-structured-streaming-aaronachermann

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps data engineers design, tune, and operate production Spark Structured Streaming pipelines so they can reliably ingest, enrich, join, and persist streaming data at scale while maintaining fault tolerance and exactly-once semantics.

Core Features & Use Cases

  • Kafka ingestion patterns: best practices for Kafka-to-Delta ingestion, Kafka-to-Kafka pipelines, and Real-Time Mode (RTM).
  • Stateful processing & joins: watermarks, RocksDB state store configuration, stream-stream and stream-static join patterns, and late-data handling.
  • Reliability & performance: checkpoint management, idempotent Delta writes (txnVersion/txnAppId), merge optimizations, multi-sink writes, and trigger/cost tuning for production workloads.

Quick Start

Build a Spark Structured Streaming job that reads from Kafka, applies an appropriate watermark, performs a left join with a Delta dimension, and writes to Delta with a persistent checkpoint at /Volumes/catalog/checkpoints/your_stream using a 30 second processingTime trigger.

Frequently Asked Questions about databricks-spark-structured-streaming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Spark Structured Streaming pipeline for Kafka to Delta Lake ingestion?

Spark Structured Streaming pipelines can ingest data from Kafka to Delta Lake by configuring a read stream from Kafka sources, applying watermarks, and writing to Delta with persistent checkpoint storage and idempotent txnVersion writes.

How do I handle late data and stateful operations in Spark Structured Streaming?

Late data and stateful operations in Spark Structured Streaming are handled by configuring watermarks and optionally enabling the RocksDB state store to manage large state efficiently while dropping or retaining data past the watermark threshold.

What is the best way to ensure exactly-once semantics when writing streams to Delta Lake?

Exactly-once semantics for Delta Lake writes are ensured by configuring idempotent writes using txnVersion and txnAppId, combined with unique persistent checkpoint locations per stream to prevent duplicate data upon restarts.

Can I perform stream-stream and stream-static joins in Databricks Structured Streaming?

Databricks Structured Streaming supports both stream-stream and stream-static joins, allowing you to enrich incoming Kafka data with Delta dimension tables while applying watermarks to manage state and avoid indefinite buffering.

How do I configure triggers and tune costs for Spark Structured Streaming on Databricks?

Trigger and cost tuning for Spark Structured Streaming on Databricks involves configuring processingTime or Real-Time Mode (RTM) triggers to balance latency and resource costs for production workloads.

Why do I need a unique checkpoint location for each Spark Structured Streaming query?

A unique checkpoint location is required for each Spark Structured Streaming query to maintain fault tolerance and exactly-once guarantees, preventing state corruption and ensuring correct recovery after failures.