databricks-spark-structured-streaming

Build Spark Structured Streaming pipelines on Databricks with Kafka and Delta Lake.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and patterns for building robust, production-ready streaming data pipelines using Spark Structured Streaming on Databricks.

Core Features & Use Cases

  • End-to-End Patterns: Covers Kafka ingestion, Delta Lake writes, stream-stream joins, stream-static joins, and merge operations.
  • Stateful Operations: Detailed configuration for watermarks and state stores, including RocksDB.
  • Performance & Cost Optimization: Best practices for triggers, cluster configuration, and cost management.
  • Use Case: Implement a real-time analytics pipeline that ingests event data from Kafka, enriches it with dimension tables, performs aggregations, and writes results to Delta Lake tables, all while handling late-arriving data and optimizing for cost.

Quick Start

Use the databricks-spark-structured-streaming skill to implement a basic Kafka to Delta streaming pipeline.

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 real-time streaming pipeline from Kafka to Delta Lake on Databricks?

To build a real-time streaming pipeline from Kafka to Delta Lake, use Spark Structured Streaming to ingest event data, apply transformations, and write results to Delta Lake tables while handling late-arriving data with watermarks.

How does Spark Structured Streaming handle stateful operations and late data?

Spark Structured Streaming handles stateful operations by configuring watermarks to drop late data and using RocksDB state stores to manage large state efficiently, ensuring robust aggregations and joins in production pipelines.

Can I join a streaming DataFrame with a static Delta table in Spark?

Yes, you can join a streaming DataFrame with a static Delta table using stream-static joins to enrich real-time event data with dimension tables without requiring the static source to be streamed.

What is the best way to optimize Spark Structured Streaming performance and cost on Databricks?

Optimize Spark Structured Streaming performance and cost by selecting appropriate triggers, configuring cluster resources efficiently, and applying best practices for state management and Delta Lake merges to reduce overhead.

How do I perform merge operations in a streaming pipeline with Delta Lake?

Perform merge operations in a streaming pipeline by writing to Delta Lake and using the merge pattern to upsert data, allowing you to update existing records and insert new ones efficiently within Structured Streaming.

When do I need watermarks in Spark Structured Streaming?

You need watermarks in Spark Structured Streaming when handling stateful operations like aggregations or stream-stream joins, as they define the threshold for accepting late data and allow the engine to drop old state.