spark-engineer

Implements and optimizes Apache Spark pipelines for distributed data processing workloads.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/ArMaTeC/Redball --skill spark-engineer-armatec
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: spark-engineer
Source: https://github.com/ArMaTeC/Redball/tree/main/.devin/skills/spark-engineer
Command: npx skills add https://github.com/ArMaTeC/Redball --skill spark-engineer-armatec

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing and tuning Apache Spark jobs is error-prone: default shuffle partitions cause slowdowns, data skew creates straggler tasks, and improper caching leads to out-of-memory failures. This Skill provides expert guidance for building production-grade Spark applications with correct partitioning, join strategies, and performance tuning. ## Core Features & Use Cases - Pipeline Implementation: Write PySpark or Scala DataFrame transformations, RDD operations, and Spark SQL queries with explicit schemas and optimized patterns. - Performance Optimization: Tune shuffle partitions, executor memory, broadcast joins, and handle data skew with salting or Adaptive Query Execution. - Structured Streaming: Build streaming pipelines with watermarks, windowed aggregations, stateful operations, and Kafka or Delta Lake sinks. - Use Case: A data engineer needs to join a 100GB fact table with a 50MB dimension table and aggregate results. The Skill recommends a broadcast join, sets appropriate shuffle partitions, and provides the complete optimized PySpark code. ## Quick Start Ask the assistant to write an optimized PySpark job that reads Parquet files, joins them with a small lookup table, and aggregates results by user.

Frequently Asked Questions about spark-engineer

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

FAQPage Schema
How do I optimize a slow Spark job?▼

Start by checking the Spark UI for shuffle spill, GC time above 10%, and uneven task durations. Tune spark.sql.shuffle.partitions based on data size, enable Adaptive Query Execution in Spark 3.x, filter data before joins, and use broadcast joins for tables under 200MB.

How do I handle data skew in Spark joins?▼

Handle skew by enabling AQE skew join handling with spark.sql.adaptive.skewJoin.enabled, or manually salt skewed keys by appending random bucket values to join keys on both sides. For extremely skewed single keys, isolate them and use a broadcast join separately.

Should I use DataFrames or RDDs in Spark?▼

Use DataFrames for structured data and SQL-like operations since they benefit from the Catalyst optimizer and Tungsten execution. Use RDDs only for unstructured data, custom partitioning logic, or fine-grained control over physical data placement.

When should I cache a DataFrame in Spark?▼

Cache a DataFrame only when it is reused multiple times in the same job or is expensive to recompute. Use MEMORY_AND_DISK storage level as a safe default, materialize with an action like count(), and call unpersist() when finished to free memory.

Why does my Spark streaming job run out of memory?▼

Streaming state grows unbounded without watermarks. Add withWatermark() on the event time column so Spark can clean up old state, and consider the RocksDB state store provider for large state. Monitor state rows in the query progress metrics.

What partition size should I use in Spark?▼

Target 128-256MB per partition with 2-4 partitions per executor core. Use repartition() to increase partitions or partition by column, and coalesce() to reduce partitions without a full shuffle, especially after filters that shrink the data.