spark-engineer

Optimize Apache Spark DataFrame and SQL workloads to reduce shuffle overhead and handle skew.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill spark-engineer-enigmaicon-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spark-engineer
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/claude-skills/skills/spark-engineer
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill spark-engineer-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write and optimize Apache Spark workloads so distributed jobs run faster, use resources efficiently, and avoid common performance pitfalls like shuffle bloat, skew, and unsafe caching.

Core Features & Use Cases

  • High-performance Spark job implementation: Write production-grade Spark (PySpark/Spark SQL) with explicit schemas, safe DataFrame patterns, and correct lazy-evaluation workflow.
  • Performance tuning & stability: Tune shuffle partitions, executor/cluster settings, and memory/caching strategy while validating behavior using Spark UI metrics.
  • Scalable transformations & reliability: Handle partitioning, broadcast joins, structured streaming patterns, and streaming state correctness with watermarks and checkpoints.

Quick Start

Ask for Spark code that reads Parquet with an explicit schema, performs an optimized filter and aggregation, tunes shuffle partitions with AQE, and verifies partition counts before writing results to the target path.

Frequently Asked Questions about spark-engineer

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

FAQPage Schema
How do I optimize Apache Spark DataFrame jobs to reduce shuffle overhead?

Optimize Apache Spark DataFrame jobs by applying explicit schemas, tuned shuffle partitions, and Adaptive Query Execution (AQE) to minimize shuffle overhead. Validating partition counts before writing outputs further reduces unnecessary data movement across cluster executors.

Why does my Spark SQL workload run out of memory during large joins?

Spark SQL workloads run out of memory during joins due to data skew and unsafe caching patterns. Resolving OOM risks requires implementing broadcast joins for small datasets, configuring executor memory correctly, and applying safeguards against bad caching and collect operations.

What's the best way to handle data skew in PySpark ETL pipelines?

The best way to handle data skew in PySpark ETL pipelines is configuring Adaptive Query Execution (AQE) to automatically split skewed partitions. Combined with validated partitioning strategies and tuned shuffle settings, this ensures balanced executor execution and stability.

How do I configure Structured Streaming checkpoints and watermarks in Spark?

Configure Structured Streaming checkpoints and watermarks in Spark by defining state correctness rules within your streaming pipeline. Setting appropriate watermark thresholds handles late data, while checkpointing guarantees fault-tolerant state recovery during distributed streaming analytics execution.

Can I use Spark UI metrics to diagnose slow PySpark performance?

You can use Spark UI metrics to diagnose slow PySpark performance by analyzing shuffle read/write volumes and executor task time. These UI signals reveal DataFrame optimization bottlenecks, guiding adjustments to partitioning, caching strategies, and cluster execution settings.

When should I use broadcast joins instead of standard shuffle joins in Spark?

Use broadcast joins in Spark instead of standard shuffle joins when working with small DataFrames to eliminate shuffle overhead entirely. Broadcasting small datasets to all executors prevents network-intensive data transfers and significantly improves overall cluster execution efficiency.