Przejdź do treści
Biblioteka skilli
Dane i analityka · Budowanie i kod

gcp-spark

/gcp-spark

Pisze i uruchamia kod Spark na Dataproc i Dataproc Serverless, czyta i zapisuje dane w BigLake Iceberg, BigQuery i Spanner oraz debuguje błędy.

Repozytorium
artemis ↗
Licencja
MIT
Ostatnia zmiana repozytorium
25.10.2026

Ocena i bezpieczeństwo

85/ 100Klasa: dobry
Format20 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
7
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 25.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pisze i uruchamia kod Spark na Dataproc i Dataproc Serverless, czyta i zapisuje dane w BigLake Iceberg, BigQuery i Spanner oraz debuguje błędy.

Wyzwalacze z opisu

t use when: - Writing generic Python scripts that don
Oryginalny opis (EN)

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.

Jak działa

  1. Task Execution Workflow
  2. Common Mistakes Checklist
  3. IAM Requirements
  4. Spark resource management
Sekcje z nagłówków SKILL.md, w oryginale · 72 linii, 365 słów
Podgląd SKILL.md
---
name: gcp-spark
description: |
  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.
license: Apache-2.0
metadata:
  version: v2
  publisher: google
---

# Spark on Dataproc

> [!IMPORTANT] You MUST ALWAYS follow the Task Execution Workflow when writing
> spark code.

## Task Execution Workflow

1.  **Understand schemas**: **ALWAYS** use `@skill:discovering-gcp-data-assets`
    skill or `resources/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.
2.  **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
        `resources/read_write_data.md` when reading or writing data.
    *   **ML Tasks**: Refer to `@skill:ml-best-practices` skill and
        `resources/ml_tasks.md` when generating ML code.
    *   **Spark Optimizations**: **ALWAYS** refer to
        `resources/spark_optimizations.md` when generating spark code and apply
        optimization whenever applicable.
3.  **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
    `resources/schema_direct_inspection.md` to verify destination schema.
4.  **Compile code before executing**: For notebooks convert them to python
    script using `jupyter nbconvert --to script your-notebook.ipynb` first, then
    compile code using `python3 -m py_compile your-notebook.py`.
5.  **Execute script**: ONLY when generating a `.py` script refer to
    `resources/gcloud_dataproc.md` on writing command to execute generated code
    on Dataproc. 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 `resources/gcloud_dataproc.md` for detailed guidelines on managing
Spark clusters, jobs, batches, and interactive sessions.
Pliki w paczce (7)
  • SKILL.json 1 KB
  • SKILL.md 4 KB
  • resources/gcloud_dataproc.md 8 KB
  • resources/ml_tasks.md 2 KB
  • resources/read_write_data.md 13 KB
  • resources/schema_direct_inspection.md 1 KB
  • resources/spark_optimizations.md 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · 420company/artemis85MIT
gemini-cli-extensions/data-agent-kit-starter-pack100Apache-2.0

Migawka bazy z 28.10.2026 · wersja paczki 21cb9c91fb1c (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100gcp-spark-troubleshooting
    Pomaga diagnozować awarie zadań Spark i Dataproc w Google Cloud (Serverless batches i klastry) oraz przeglądać, przeszukiwać i podsumowywać wyjścia drivera i logi zdarzeń Spark w Cloud Storage.
  • 95discovering-gcp-data-assets
    Wyszukuje i sprawdza zasoby danych w Google Cloud: zbiory i tabele BigQuery, tabele BigLake, instancje Spanner, schematy i polityki.
  • 90gcp-managed-spark-upgrades
    Przenosi zadania Spark w Dataproc na nowszą wersję obrazu: analizuje je, poprawia i testuje na docelowej wersji.
  • 90bigquery-and-dataform-platform-engineering
    Prowadzi przez inżynierię danych wokół BigQuery i Dataform: modele fizyczne, granice ingestu, przepływy transformacji, kontrola slotów i kosztów oraz wybór między BigQuery, Dataflow i Dataproc.
  • 100spark-sql-optimizer
    Prawdopodobnie optymalizuje zapytania Spark SQL w potokach danych, pomagając poprawić wydajność operacji w ramach kategorii Data Pipelines.
  • 86spark
    Pomaga w obliczeniach Spark: zapytaniach Spark SQL, Structured Streaming, RDD i przetwarzaniu dużych danych.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.