databricks-spark-structured-streaming

Build Spark Structured Streaming pipelines with Kafka ingestion and Delta sinks.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/itsadijmbt/SecureMCP-Servers --skill databricks-spark-structured-streaming-itsadijmbt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-spark-structured-streaming
Source: https://github.com/itsadijmbt/SecureMCP-Servers/tree/main/TEST_SERVERS/PORTED_TO_SECUREMCP/databrickslab-mcp/ai-dev-kit/databricks-skills/databricks-spark-structured-streaming
Command: npx skills add https://github.com/itsadijmbt/SecureMCP-Servers --skill databricks-spark-structured-streaming-itsadijmbt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you design Spark Structured Streaming workloads that stay reliable in production, even when handling late data, stateful operations, and multiple sinks.

Core Features & Use Cases

  • Streaming pipeline patterns: Kafka ingestion, stream-stream and stream-static joins, multi-sink fan-out, and MERGE-based upserts.
  • Production-grade configuration: checkpoint management, trigger tuning (processingTime, availableNow), and Real-Time Mode (RTM) guidance.
  • Operational safety: watermarking for state cleanup, checkpoint persistence best practices, and monitoring-friendly setup.

Quick Start

Ask the assistant: “Provide a Spark Structured Streaming template that reads from Kafka, parses JSON, writes to Delta with a persistent unique checkpoint, and uses 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 that reads from Kafka and writes to Delta?

To build a Spark Structured Streaming pipeline, you ingest data from Kafka, parse the payload, and write to Delta using a persistent unique checkpoint location. Selecting a processingTime or availableNow trigger ensures reliable, deterministic production behavior.

What's the best way to handle late data in Spark Structured Streaming stateful operations?

Handling late data in Spark Structured Streaming requires explicit watermarking to define the threshold for accepting late records. Watermarks enable automatic state cleanup, preventing unbounded state growth while ensuring correct operational safety in production pipelines.

When do I need explicit watermarks for state cleanup in Spark streaming workloads?

You need explicit watermarks for state cleanup in Spark streaming workloads when performing stateful operations like stream-stream joins. Without watermarking, state data grows indefinitely, so setting a watermark threshold drops old state and maintains operational safety.

Does Spark Structured Streaming support MERGE-based upserts into Delta sinks?

Spark Structured Streaming supports MERGE-based upserts into Delta sinks using foreachBatch. This pattern allows you to apply conditional updates and inserts to existing Delta tables, providing reliable idempotent writes for streaming pipeline integrations.

Why does my Spark streaming pipeline fail with checkpoint location errors in production?

Spark streaming pipelines fail with checkpoint errors when a persistent unique checkpoint location is missing or reused across queries. Ensuring each streaming query has a dedicated, durable checkpoint path prevents state corruption and maintains production-grade reliability.

Can I use stream-static joins with Spark Structured Streaming for real-time enrichment?

You can use stream-static joins in Spark Structured Streaming to enrich real-time streaming data against static batch sources. This pattern does not require a watermark for the static side, allowing you to augment streaming Kafka ingestion with dimensional reference data.