manutej/luxor-claude-marketplace/apache-spark-data-processing
Claude Code and agent skill by manutej/luxor-claude-marketplace
- community
Checking that the SKILL.md file is still in the repository.
Complete guide for Apache Spark data processing including RDDs, DataFrames, Spark SQL, streaming, MLlib, and production deployment
Install
npx vskill@latest install manutej/luxor-claude-marketplace/apache-spark-data-processingSKILL.md
Apache Spark Data Processing
A comprehensive skill for mastering Apache Spark data processing, from basic RDD operations to advanced streaming, SQL, and machine learning workflows. Learn to build scalable, distributed data pipelines and analytics systems.
When to Use This Skill
Use Apache Spark when you need to:
- Process Large-Scale Data: Handle datasets too large for single-machine processing (TB to PB scale)
- Perform Distributed Computing: Execute parallel computations across cluster nodes
- Real-Time Stream Processing: Process continuous data streams with low latency
- Complex Data Analytics: Run sophisticated analytics, aggregations, and transformations
- Machine Learning at Scale: Train ML models on massive datasets
- ETL/ELT Pipelines: Build robust data transformation and loading workflows
- Interactive Data Analysis: Perform exploratory analysis on large datasets
- Unified Data Processing: Combine batch and streaming workloads in one framework
Not Ideal For:
- Small datasets (<100 GB) that fit in memory on a single machine
- Simple CRUD operations (use traditional databases)
- Ultra-low latency requirements (<10ms) where specialized stream processors excel
- Workflows requiring strong ACID transactions across distributed data
Core Concepts
Resilient Distributed Datasets (RDDs)
RDDs are Spark's fundamental data abstraction - immutable, distributed collections of objects that can be processed in parallel.
Key Characteristics:
- Resilient: Fault-tolerant through lineage tracking
- Distributed: Partitioned across cluster nodes
- Immutable: Transformations create new RDDs, not modify existing ones
- Lazy Evaluation: Transformations build computation graph; actions trigger execution
- In-Memory Computing: Cache intermediate results for iterative algorithms
RDD Operations:
- Transformations: Lazy operations that return new RDDs (map, filter, flatMap, reduceByKey)
- Actions: Operations that trigger computation and return values (collect, count, reduce, saveAsTextFile)
When to Use RDDs:
- Low-level control over data distribution and partitioning
- Custom partitioning schemes required
- Working with unstructured data (text files, binary data)
- Migrating legacy code from early Spark versions
Prefer DataFrames/Datasets when possible - they provide automatic optimization via Catalyst optimizer.
DataFrames and Datasets
DataFrames are distributed collections of data organized into named columns - similar to a database table or pandas DataFrame, but with powerful optimizations.
DataFrames:
- Structured data with schema
- Automatic query optimization (Catalyst)
- Cross-language support (Python, Scala, Java, R)
- Rich API for SQL-like operations
Datasets (Scala/Java only):
- Typed DataFrames with compile-time type safety
- Best performance in Scala due to JVM optimization
- Combine RDD type safety with DataFrame optimizations
Key Advantages Over RDDs:
- Query Optimization: Catalyst optimizer rewrites queries for efficiency
- Tungsten Execution: Optimized CPU and memory usage
- Columnar Storage: Efficient data representation
- Code Generation: Compile-time bytecode generation for faster execution
Lazy Evaluation
Spark uses lazy evaluation to optimize execution:
- Transformations build a Directed Acyclic Graph (DAG) of operations
- Actions trigger execution of the DAG
- Spark's optimizer analyzes the entire DAG and creates an optimized execution plan
- Work is distributed across cluster nodes
Benefits:
- Minimize data movement across network
- Combine multiple operations into single stage
- Eliminate unnecessary computations
- Optimize memory usage
Partitioning
Data is divided into partitions for parallel processing:
- Default Partitioning: Typically based on HDFS block size or input source
- Hash Partitioning: Distribute data by key hash (used by groupByKey, reduceByKey)
- Range Partitioning: Distribute data by key ranges (useful for sorted data)
- Custom Partitioning: Define your own partitioning logic
Partition Count Considerations:
- Too few partitions: Underutilized cluster, large task execution time
- Too many partitions: Scheduling overhead, small task execution time
- General rule: 2-4 partitions per CPU core in cluster
- Use
repartition()orcoalesce()to adjust partition count
Caching and Persistence
Cache frequently accessed data in memory for performance:
When to Cache:
- Data used multiple times in workflow
- Iterative algorithms (ML training)
- Interactive analysis sessions
- Expensive transformations reused downstream
When Not to Cache:
- Data used only once
- Very large datasets that exceed cluster memory
- Streaming applications with continuous new data
Spark SQL
Spark SQL allows you to query structured data using SQL or DataFrame API:
- Execute SQL queries on DataFrames and tables
- Register DataFrames as temporary views
- Join structured and semi-structured data
- Connect to Hive metastore for table metadata
- Support for various data sources (Parquet, ORC, JSON, CSV, JDBC)
Performance Features:
- Catalyst Optimizer: Rule-based and cost-based query optimization
- Tungsten Execution Engine: Whole-stage code generation, vectorized processing
- Adaptive Query Execution (AQE): Runtime optimization based on statistics
- Dynamic Partition Pruning: Skip irrelevant partitions during execution
Broadcast Variables and Accumulators
Shared variables for efficient distributed computing:
Broadcast Variables:
- Read-only variables cached on each node
- Efficient for sharing large read-only data (lookup tables, ML models)
- Avoid sending large data with every task
Accumulators:
- Write-only variables for aggregating values across tasks
- Used for counters and sums in distributed operations
- Only driver can read final accumulated value
Spark SQL Deep Dive
DataFrame Creation
Create DataFrames from various sources:
DataFrame Operations
Common DataFrame transformations:
SQL Queries
Execute SQL on DataFrames:
Data Sources
Spark SQL supports multiple data formats:
Parquet (Recommended for Analytics):
- Columnar storage format
- Excellent compression and query performance
- Schema embedded in file
- Supports predicate pushdown and column pruning
ORC (Optimized Row Columnar):
- Similar to Parquet with slightly better compression
- Preferred for Hive integration
- Built-in indexes for faster queries
JSON (Semi-Structured Data):
- Human-readable but less efficient
- Schema inference on read
- Good for nested/complex data
CSV (Legacy/Simple Data):
- Widely compatible but slow
- Requires header inference or explicit schema
- Minimal compression benefits
Window Functions
Advanced analytics with window functions:
User-Defined Functions (UDFs)
Create custom transformations:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationWarning, 73 of 100Marginal. 1 run. Evaluated 8 months ago.
Source
- SKILL.md in the repositoryCheckingplugins/luxor-data-engineering/skills/apache-spark-data-processing/SKILL.md
Popularity
- Repository stars
- 53
- Repository forks
- 14
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/manutej/luxor-claude-marketplace/apache-spark-data-processing)