spark-declarative-pipelines

Create and configure Databricks Lakeflow Spark Declarative Pipelines with SQL or Python.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/FMurray/mlfts --skill spark-declarative-pipelines-fmurray
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spark-declarative-pipelines
Source: https://github.com/FMurray/mlfts/tree/main/.agents/skills/spark-declarative-pipelines
Command: npx skills add https://github.com/FMurray/mlfts --skill spark-declarative-pipelines-fmurray

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building streaming and batch data pipelines on Databricks requires deep knowledge of Spark Declarative Pipelines syntax, Auto Loader ingestion, CDC/SCD patterns, and performance tuning, which is scattered across documentation and easy to get wrong. ## Core Features & Use Cases - Ingestion & Streaming Patterns: Auto Loader with read_files for JSON, CSV, Parquet, and Avro, plus Kafka, Event Hub, and Kinesis streaming sources with deduplication and windowed aggregations. - CDC & SCD Type 2: AUTO CDC flows, temporal queries with __START_AT/__END_AT columns, and point-in-time analysis patterns. - Performance & Migration: Liquid Clustering guidance, modern pyspark.pipelines API versus legacy DLT comparison, and a DLT-to-SDP migration decision matrix. - Use Case: A data engineer needs to build a bronze/silver/gold medallion pipeline ingesting JSON files from cloud storage with SCD Type 2 customer history; the skill provides ready-made SQL patterns and Asset Bundle project scaffolding via databricks pipelines init. ## Quick Start Ask the assistant to create a Lakeflow Spark Declarative Pipeline that ingests JSON files from cloud storage into a bronze streaming table and builds silver and gold transformations.

Frequently Asked Questions about spark-declarative-pipelines

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

FAQPage Schema
How do I create a streaming table with Auto Loader in Spark Declarative Pipelines?

Use CREATE OR REPLACE STREAMING TABLE with FROM STREAM read_files, specifying the cloud storage path, format, and schemaHints. The STREAM keyword is required in streaming table queries, and read_files leverages Auto Loader for incremental file processing.

What is the difference between pyspark.pipelines and the legacy dlt API?

The modern pyspark.pipelines API (imported as dp) is recommended for new projects and supports Liquid Clustering via cluster_by and explicit Unity Catalog paths. The legacy dlt API uses dlt.read with implicit LIVE schema and dlt.apply_changes instead of dp.create_auto_cdc_flow.

How do I implement SCD Type 2 in Databricks Lakeflow pipelines?

Create a streaming table target, then define a flow with AUTO CDC INTO specifying KEYS, SEQUENCE BY for event ordering, and STORED AS SCD TYPE 2. Query history using the auto-generated __START_AT and __END_AT columns, filtering __END_AT IS NULL for current records.

Should I use Liquid Clustering or PARTITION BY for Delta tables?

Liquid Clustering with CLUSTER BY is the recommended approach, replacing PARTITION BY and Z-ORDER with adaptive multi-dimensional clustering. Use PARTITION BY only for regulatory physical separation, partition-level retention drops, or older Delta Lake versions.

When should I migrate DLT Python pipelines to SDP SQL?

Migrate when 80% or more of the logic is SQL-expressible, such as filters, aggregations, joins, and simple CASE expressions. Stay in Python when pipelines rely on complex UDFs, external API calls, custom libraries, or ML model inference.

Why is my streaming table query failing with a batch query error?

The error occurs when a streaming table query lacks the STREAM keyword with read_files, producing a batch instead of streaming source. Use FROM STREAM read_files so the source is streaming, especially when feeding downstream AUTO CDC flows.