databricks-spark-structured-streaming

Build Spark Structured Streaming pipelines ingesting to Delta and Kafka.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams build, operate, and optimize reliable Spark Structured Streaming pipelines for production use, reducing data loss, state explosion, and operational cost while ensuring exactly-once durability.

Core Features & Use Cases

  • Robust Ingestion: Patterns for Kafka-to-Delta and Kafka-to-Kafka ingestion with consumer/producer tuning and security (SASL/SSL).
  • Stateful Processing & Joins: Watermark configuration, RocksDB state store guidance, stream-stream and stream-static join best practices.
  • Durable Writes & Merges: Checkpoint management, idempotent writes with txnVersion/txnAppId, parallel MERGE patterns and Liquid Clustering optimizations.
  • Operational Patterns: Trigger and cost tuning (processingTime, availableNow, RTM), multi-sink writes, monitoring checks, and production checklists.
  • Real-World Example: Implement a Kafka-to-Delta medallion pipeline that enriches events with dimension tables, writes bronze/silver/gold sinks in one ForEachBatch, and uses persistent UC checkpointing for fault recovery.

Quick Start

Start a Kafka-to-Delta streaming job that reads from topic "topic", enriches events with Delta dimension tables, writes to /delta/bronze_events with a persistent checkpoint at /Volumes/catalog/checkpoints/bronze_events and 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 production-grade Kafka to Delta streaming pipeline with checkpointing?

Build a Kafka to Delta streaming pipeline by reading from Kafka topics, enriching events with Delta dimension tables, and writing to persistent checkpoint locations like Unity Catalog volumes to ensure exactly-once durability and fault recovery during stateful processing.

What's the best way to handle stateful aggregations and stream-stream joins in Spark Structured Streaming?

Handle stateful aggregations and stream-stream joins by configuring watermarks to manage late data and leveraging the RocksDB state store. This prevents state explosion while maintaining accurate results across complex event processing workflows.

Can I use Spark Structured Streaming for CDC merges and multi-sink writes on Databricks?

Yes, Spark Structured Streaming supports CDC merges and multi-sink writes on Databricks. You can implement parallel MERGE patterns and write to bronze, silver, and gold sinks simultaneously within a single ForEachBatch operation.

How do I prevent duplicate records when writing streaming data to Delta Lake?

Prevent duplicate records in Delta Lake by implementing idempotent writes using transaction versions and application IDs. This exactly-once durability mechanism ensures streaming data is not duplicated during pipeline restarts or failures.

Does this Spark Structured Streaming approach work with Microsoft Fabric Real-Time Mode?

Yes, the streaming patterns apply to Microsoft Fabric Real-Time Mode scenarios. You can tune triggers using processingTime, availableNow, and RTM configurations to optimize operational costs and processing latency across platforms.

When should I use Liquid Clustering for Delta streaming sinks?

Use Liquid Clustering for Delta streaming sinks to optimize query performance during continuous data ingestion. It replaces traditional partitioning and Z-Ordering, automatically adapting data layout as streaming volumes grow.