spark
Skill15 starsChanged 43 days agoMITView on GitHub
Expert Apache Spark assistance covering PySpark, Spark SQL, DataFrame transformations, broadcast joins, and cluster optimization. Use when processing petabyte distributed data and running big data ETL pipelines.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- supabase/evalstheir own version, first seen Nov 8, 2026
- huuphuoc1396/android-claude-skillstheir own version, first seen Nov 1, 2026
- simota/agent-skillstheir own version, first seen Oct 23, 2026
- Noah0025/sparktheir own version, first seen Oct 20, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- geeks-accelerator/in-bed-aitheir own version, first seen Sep 29, 2026
Used with
Projects with it also use Forge.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ikennaokpalaSkillForge
Autonomous quality engineering swarm that forges production-ready code through continuous behavioral verification, exhaustive E2E testing, and self-healing fix loops. Combines DDD+ADR+TDD methodology with BDD/Gherkin specifications, 7 quality gates, defect prediction, chaos testing, and cross-context dependency awareness. Architecture-agnostic - works with monoliths, microservices, modular monoliths, and any bounded-context topology.
Also in 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- supabase/evals★ 151same name
- tance-mang/chinese-webnovel-skills★ 97same name
- simota/agent-skills★ 96same name
- wishworldbetter/seedex-skills★ 50same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- geeks-accelerator/in-bed-ai★ 26same name
- a-lottes/aSPARK★ 25same name
- huuphuoc1396/android-claude-skills★ 1same name
- jord0-cmd/jord0.skills★ 1same name
- Noah0025/spark★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- service-meshSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 128
Use F.broadcast() when joining a large DataFrame with a small table (< 100MB) to eliminate shuffle overhead.
- Very specific: line 129
Always specify an explicit checkpointLocation on durable cloud storage for Structured Streaming jobs.
- Very specific: line 135
Use Python UDFs (@udf) if native pyspark.sql.functions exist.
- Very specific: line 136
Leave small file problems unaddressed.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Apache Spark
Apache Spark is a multi-language engine for executing data engineering, data science, and machine learning on single-node machines or large distributed clusters with Spark Connect.
When to Use
- Petabyte-Scale Distributed Data Processing: Transforming massive datasets across cloud clusters with Apache Spark 3.5+.
- Real-Time Streaming Pipelines: Low-latency stream processing with Spark Structured Streaming.
- Enterprise Lakehouse Architectures: Querying and updating Delta Lake, Apache Iceberg, and Apache Hudi tables.
- Distributed SQL & Complex Analytical Aggregations: Distributed joins, window functions, and analytics with Catalyst Optimizer.
Quick Start
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, avg
spark = SparkSession.builder \
.appName("AnalyticsETL") \
.config("spark.sql.shuffle.partitions", "200") \
.getOrCreate()
df = spark.read.parquet("s3a://data-lake/sales/")
summary = df.groupBy("country").agg(avg("amount").alias("avg_spent"))
summary.write.mode("overwrite").parquet("s3a://data-lake/reports/summary/")Core Concepts
Structured DataFrame Transformations & Window Functions
Distributed analytical querying with PySpark:
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
from pyspark.sql.window import Window
spark = SparkSession.builder \
.appName("CustomerAnalytics2026") \
.config("spark.sql.adaptive.enabled", "true") \
.config("spark.sql.shuffle.partitions", "200") \
.getOrCreate()
# Read partitioned Parquet from cloud storage
df = spark.read.parquet("s3a://data-lake/transactions/")
# Define window partitioned by customer ordered by timestamp
customer_window = Window.partitionBy("customer_id").orderBy("transaction_time")
# Compute cumulative spend and previous transaction date
enhanced_df = df.filter(F.col("status") == "COMPLETED") \
.withColumn("running_total", F.sum("amount").over(customer_window)) \
.withColumn("prev_transaction_time", F.lag("transaction_time", 1).over(customer_window)) \
.withColumn("days_since_last", F.datediff(F.col("transaction_time"), F.col("prev_transaction_time")))
enhanced_df.write \
.mode("overwrite") \
.partitionBy("region") \
.parquet("s3a://data-lake/marts/customer_summary/")Broadcast Joins for Skewed Dimensions
Optimizing distributed joins between large fact tables and small dimension lookup tables:
# Broadcast small dimension table to all executors, eliminating expensive shuffles
dimension_df = spark.read.parquet("s3a://data-lake/dimensions/merchant_tiers/")
joined_df = df.join(
F.broadcast(dimension_df),
on="merchant_id",
how="inner"
)Spark Structured Streaming from Kafka
Continuous stream processing with checkpointing:
stream_df = spark.readStream \
.format("kafka") \
.option("kafka.bootstrap.servers", "kafka:9092") \
.option("subscribe", "telemetry-events") \
.load()
parsed_stream = stream_df.selectExpr("CAST(value AS STRING) as json_payload")
query = parsed_stream.writeStream \
.format("parquet") \
.option("path", "s3a://data-lake/raw_stream/") \
.option("checkpointLocation", "s3a://data-lake/checkpoints/telemetry/") \
.trigger(processingTime="1 minute") \
.start()Common Patterns
Broadcast Join for Skewed Dimensions
Problem: Joining a small lookup table with a massive distributed fact table causes slow shuffle exchanges across executors.
Solution: Broadcast the small table to all worker nodes:
from pyspark.sql.functions import broadcast
large_fact_df = spark.read.parquet("events/")
small_dim_df = spark.read.csv("country_codes.csv", header=True)
# Broadcast join eliminates shuffle network overhead
result_df = large_fact_df.join(broadcast(small_dim_df), "country_id")Best Practices
Do:
- Enable Adaptive Query Execution (
spark.sql.adaptive.enabled=true) for automatic partition coalescing and join optimization. - Use
F.broadcast()when joining a large DataFrame with a small table (< 100MB) to eliminate shuffle overhead. - Always specify an explicit
checkpointLocationon durable cloud storage for Structured Streaming jobs. - Cache or persist (
df.persist()) intermediate DataFrames only when reused multiple times in the same job.
Don't:
- Collect massive DataFrames to the driver node (
df.collect()); write directly to cloud storage. - Use Python UDFs (
@udf) if nativepyspark.sql.functionsexist; native functions avoid JVM-Python serialization overhead. - Leave small file problems unaddressed; use Delta Lake
OPTIMIZEor coalesce partitions before writing.
Troubleshooting
| Error | Cause | Solution |
java.lang.OutOfMemoryError: Java heap space on Executor | Data skew or partition sizes too large for executor memory. | Increase spark.executor.memory or salt skewed keys before grouping. |
Container killed by YARN for exceeding memory limits | Off-heap overhead or Python process exceeding memory threshold. | Increase spark.yarn.executor.memoryOverhead to 1GB+. |
Total size of serialized results is bigger than spark.driver.maxResultSize | Calling .collect() on massive distributed DataFrame. | Write output to disk or use .take(100) instead of collecting entire dataset. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

