1919114514yasenpai-maker/focus-quest/gcp-spark
Claude Code and agent skill by 1919114514yasenpai-maker/focus-quest
- community
Checking that the SKILL.md file is still in the repository.
Develops and executes Spark code on Dataproc Clusters and Serverless. Reads and writes data using BigLake Iceberg catalogs, BigQuery and Spanner. Debugs execution failures. Use when: - Writing Spark ETL pipelines on GCP. - Training or running inference with ML models with spark on GCP. - Managing Spark clusters, jobs, batches, and interactive sessions. Don't use when: - Writing generic Python scripts that don't use Spark. - Performing simple SQL queries that can be done directly in BigQuery.
Install
npx vskill@latest install 1919114514yasenpai-maker/focus-quest/gcp-sparkSKILL.md
The same SKILL.md was published earlier as krishp091205/gemini-config/gcp-spark.
Spark on Dataproc
[!IMPORTANT]You MUST ALWAYS follow the Task Execution Workflow when writing spark code.
Task Execution Workflow
- Understand schemas: ALWAYS use
@skill:discovering-gcp-data-assets
skill or references/schema_direct_inspection.md to understand input and output schemas. Include the schema in your thought process BEFORE generating any code. Do NOT guess column names. Unless explicitly specified, assume that the assets are located in the same project. Avoid scanning for assets across other projects as it can take a long time.
- Verify source accessibility: verify access/existence using `gcloud
storage ls gs://<path-to-dataset>. If accessing or reading a GCS path fails with a storage error e.g., permission errors like 403 Forbidden/Forbidden/PermissionDenied, or location errors like 404 Not Found/NotFound/FileNotFoundException` you should report the error immediately. Either (1) ask the user what to do next, or (2) if asked to execute a notebook, save the notebook with the error output and recommend next steps to resolve the issue. Do NOT scan all buckets for alternative fallback datasets when encountering GCS errors.
- Generate spark code:
- Output Format: ALWAYS generate code in **Python Notebooks
(.ipynb)** format. Generate scripts (.py) only if explicitly requested.
- Read and Write data: ALWAYS Refer to
references/read_write_data.md when reading or writing data.
- ML Tasks: Refer to
@skill:ml-best-practicesskill and
references/ml_tasks.md when generating ML code.
- Spark Optimizations: ALWAYS refer to
references/spark_optimizations.md when generating spark code and apply optimization whenever applicable.
- Verify schema before write: ALWAYS verify that the dataframe and
destination schema match, use df.printSchema() for dataframe schema and refer to @skill:discovering-gcp-data-assets skill or references/schema_direct_inspection.md to verify destination schema.
- Compile code before executing: For notebooks convert them to python
script using jupyter nbconvert --to script your-notebook.ipynb first. Then compile the resulting python script using python3 -m py_compile your-script.py. The same can be done for pyspark source code.
- Execute script: When requested to run a job, script, session refer to
references/gcloud_dataproc.md on how to execute generated code on Managed Spark. This DOES NOT apply when generating notebooks.
Common Mistakes Checklist
[!CAUTION]Ensure you verify this checklist to avoid mistakes
Before submitting a job, verify:
- [ ] All imports present (
col,when,lit, etc. from
pyspark.sql.functions)
- [ ] `vector_to_array` from correct module use `from pyspark.ml.functions
import vector_to_array (NOT pyspark.sql.functions`)
- [ ] DataFrame schema matches target Iceberg table verify with
df.printSchema() before writing
- [ ] CSV files read with `header` and `inferSchema` without these, the
header row becomes data and all columns are strings
- [ ] Avoid toPandas() Converting a pyspark dataframe to pandas by calling
toPandas() can lead to out of memory errors. Only acceptable for building visualizations in Spark 3.5
IAM Requirements
The Dataproc service account needs:
-
roles/dataproc.worker: Job execution -
roles/biglake.admin: Iceberg table management -
roles/bigquery.jobUser: Query materialization -
roles/storage.objectUser: Read/write GCS -
roles/spanner.databaseUser: Spanner writes
Spark resource management
Refer to references/gcloud_dataproc.md for detailed guidelines on managing Spark clusters, jobs, batches, and interactive sessions.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.codeoss/data/User/globalStorage/googlecloudtools.datacloud/skill_bases/gcp-spark/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
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/1919114514yasenpai-maker/focus-quest/gcp-spark)