spark-best-practices
General Apache Spark best practices for scalable, maintainable DataFrame jobs: avoid driver materialization, reduce shuffle, join efficiently, and cache carefully. Use when optimizing Spark performance, reviewing PySpark jobs, or writing new DataFrame pipelines.
Install
With your agent
Install OMGSkills skill "oleanderhq/claude-plugin:skills/spark-best-practices" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.
Manual command
git clone https://github.com/OleanderHQ/claude-plugin /tmp/claude-plugin && ln -s /tmp/claude-plugin/skills/spark-best-practices ~/.claude/skills/spark-best-practices
From README
Spark Best Practices Use this skill for general Apache Spark guidance when optimizing performance, reliability, and maintainability. 1) Keep execution distributed Avoid collect(), toPandas(), and large take() in core data paths. Materialize to driver memory only for very small control outputs (metrics, IDs, summaries). Keep heavy transformation and write paths in Spark DataFrame execution. 2) Prefer DataFrame APIs to Python loops Use Spark SQL/DataFrame functions so Catalyst can optimize execution plans. Avoid row-by-row Python logic when equivalent DataFrame expressions exist. Keep transformations declarative and composable. 3) Reduce shuffle cost Project and filter early to reduce data volume before joins/aggregations. Repartition intentionally before heavy joins/writes. Use coalesce when reducing output partitions. Watch for skewed keys and apply skew mitigation. 4) Use efficient joins Broadcast small dimension tables when appropriate.
More from this repo
lake-catalog
Engine-agnostic oleander lake catalog conventions: catalog.namespace.table naming, hierarchy, and catalog-qualified...
lake-query
Runs lake SQL through oleander's query router: query_run for reads, query_submit for writes, spark_sql_submit for named...
polars-submit
Runs Polars queries or scripts on oleander via the CLI, in local or distributed mode, and saves results to the lake...
