spark-to-beam-translator

Migrates PySpark Delta Lake streaming pipelines to Apache Beam on Google Cloud Dataflow.

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill spark-to-beam-translator-ricardolui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spark-to-beam-translator
Source: https://github.com/ricardolui/gcp-custom-agent-skills/tree/main/spark-to-beam-translator
Command: npx skills add https://github.com/ricardolui/gcp-custom-agent-skills --skill spark-to-beam-translator-ricardolui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires apache-beam, fastavro.

What problem does it solve? Migrating Databricks PySpark Delta Lake medallion streaming pipelines to Google Cloud is error-prone when done as a literal 1-to-1 conversion, leading to unnecessary cost, latency, and architectural overhead. This Skill provides architectural mappings, code translation patterns, and cost models for moving to Apache Beam on Dataflow with BigQuery. ## Core Features & Use Cases - Architecture Mapping: Translates Bronze/Silver/Gold Delta Lake layers into native GCP equivalents using KafkaIO, BigQuery Storage Write API, and Dataform/dbt, eliminating the GCS staging sync stream entirely. - Code Translation Patterns: Provides PySpark-to-Beam conversions for Kafka Avro deserialization, stateful deduplication with State & Timers, and side-input dimension enrichment joins. - Cost & Performance Modeling: Supplies formulas comparing Databricks 24/7 cluster plus DBU costs against Dataflow serverless autoscaling, plus latency comparisons between micro-batch and record-by-record streaming. - Use Case: A data engineer needs to migrate a six-stream Databricks payment pipeline to GCP. Use this Skill to map each Delta stream to its Beam/BigQuery equivalent, translate the MERGE deduplication logic into Beam stateful transforms, and build the cost comparison for stakeholders. ## Quick Start Ask the assistant to translate your PySpark Delta Lake streaming pipeline into an Apache Beam Dataflow pipeline with a cost comparison against your current Databricks setup.

Frequently Asked Questions about spark-to-beam-translator

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

FAQPage Schema
How do I migrate a PySpark Delta Lake streaming pipeline to Apache Beam?

Map each Delta Lake layer to its GCP equivalent rather than converting one-to-one: stream Kafka directly into BigQuery Bronze tables via KafkaIO and the Storage Write API, deduplicate with Beam stateful transforms or dbt incremental models, and build Gold joins with Beam side inputs or BigQuery SQL.

How to replace Spark foreachBatch Delta MERGE deduplication in Apache Beam?

Use a Beam stateful DoFn with a ReadModifyWriteStateSpec keyed on the deduplication key and a timer for TTL expiry, emitting only first-seen records. Alternatively, ingest raw events into BigQuery Bronze and apply MERGE keys through Dataform or dbt incremental materialization.

Databricks vs Dataflow cost for streaming pipelines?

Databricks streaming requires a cluster running 24/7 with VM plus DBU charges regardless of throughput, while Dataflow autoscales down to a single worker during low traffic with no licensing markup. Streaming directly to BigQuery also eliminates GCS staging and continuous MERGE DML costs.

Can Apache Beam join streaming data with slowly changing dimension tables?

Yes, use Beam side inputs to load slow-moving dimensions like countries or merchants as a dictionary and enrich each streaming record in a Map transform. For key-aligned matching between two streams, use CoGroupByKey instead.

What is the latency difference between Spark micro-batch and Dataflow streaming?

Spark structured streaming uses micro-batches triggered at intervals, giving typical latencies of 10 to 60 seconds due to per-batch scheduling overhead. Dataflow processes record-by-record, achieving sub-second to roughly two-second latency from Kafka publish to BigQuery write.