This skill enforces the Zero-Copy Architecture of the modern Google Cloud
Lakehouse. It eliminates the overhead of copying data to external compute
engines or creating intermediate files (CSVs/JSONs) on GCS.
It standardizes:
Reading from BigQuery directly into Spark DataFrames using the
Spark-BigQuery connector.
Reading from BigQuery using BigQuery DataFrames (bigframes.pandas) for
in-warehouse processing.
2. Environment Prerequisites
Spark: Managed Service for Apache Spark Serverless (Runtime 3.0+
recommended) with the Spark BigQuery Connector pre-bundled.
BigQuery: bigframes Python package installed.
3. Agent Execution Guidelines (System Prompts)
When generating data loading or exploration code:
Never export to GCS first: Do not write code that exports BigQuery
tables to GCS as CSV/Avro/Parquet before loading them into Spark or Pandas.
Use BigQuery Storage API: Ensure Spark reads use the "bigquery"
format, which utilizes the high-speed BigQuery Storage Read API.
Use BigFrames for BQ: Ensure BigQuery-centric pipelines use
bigframes.pandas.read_gbq to create references to the tables.
4. Opinionated Code Patterns
A. Spark-Centric Zero-Copy Load
Use the Spark-BigQuery connector to load tables directly.
Use BigQuery DataFrames to create a virtual DataFrame.
import bigframes.pandas as bpd
# Configure BigQuery DataFrames global options
bpd.options.bigquery.project = PROJECT_ID
bpd.options.bigquery.location = "US" # Or your dataset location
# Load table reference (zero data movement)
users_df = bpd.read_gbq("bigquery-public-data.thelook_ecommerce.users")
5. Verification Checklist
No GCS Export: Verify the code does not contain bq extract or GCS
export steps before loading.
Spark Format: Ensure the Spark read format is explicitly "bigquery".
BigFrames Config: Ensure bpd.options.bigquery.project is set before
calling read_gbq.
1---2name: zero-copy-ingestion3description: Skill: Zero-Copy Data Exploration & Ingestion4---5# Skill: Zero-Copy Data Exploration & Ingestion67<!--8 Disabling markdownlint MD029 to provide explicit ordering to avoid9 confusing the LLM.10-->11<!-- markdownlint-disable MD029 -->1213## 1. Description & Rationale1415This skill enforces the **Zero-Copy Architecture** of the modern Google Cloud16Lakehouse. It eliminates the overhead of copying data to external compute17engines or creating intermediate files (CSVs/JSONs) on GCS.1819It standardizes:20211. Reading from BigQuery directly into Spark DataFrames using the22 Spark-BigQuery connector.232. Reading from BigQuery using BigQuery DataFrames (`bigframes.pandas`) for24 in-warehouse processing.2526## 2. Environment Prerequisites2728- **Spark**: Managed Service for Apache Spark Serverless (Runtime 3.0+29 recommended) with the Spark BigQuery Connector pre-bundled.30- **BigQuery**: `bigframes` Python package installed.3132## 3. Agent Execution Guidelines (System Prompts)3334When generating data loading or exploration code:35361. **Never export to GCS first**: Do not write code that exports BigQuery37 tables to GCS as CSV/Avro/Parquet before loading them into Spark or Pandas.382. **Use BigQuery Storage API**: Ensure Spark reads use the `"bigquery"`39 format, which utilizes the high-speed BigQuery Storage Read API.403. **Use BigFrames for BQ**: Ensure BigQuery-centric pipelines use41 `bigframes.pandas.read_gbq` to create references to the tables.4243## 4. Opinionated Code Patterns4445### A. Spark-Centric Zero-Copy Load4647Use the Spark-BigQuery connector to load tables directly.4849```python50# Load BigQuery table directly into Spark DataFrame51users_df = (52 spark.read.format("bigquery")53 .option("table", "bigquery-public-data.thelook_ecommerce.users")54 .load()55)5657# Create temporary view for Spark SQL queries58users_df.createOrReplaceTempView("users")59```6061### B. BigQuery-Centric Zero-Copy Load6263Use BigQuery DataFrames to create a virtual DataFrame.6465```python66import bigframes.pandas as bpd6768# Configure BigQuery DataFrames global options69bpd.options.bigquery.project = PROJECT_ID70bpd.options.bigquery.location = "US" # Or your dataset location7172# Load table reference (zero data movement)73users_df = bpd.read_gbq("bigquery-public-data.thelook_ecommerce.users")74```7576## 5. Verification Checklist7778- [ ] **No GCS Export**: Verify the code does not contain `bq extract` or GCS79 export steps before loading.80- [ ] **Spark Format**: Ensure the Spark read format is explicitly `"bigquery"`.81- [ ] **BigFrames Config**: Ensure `bpd.options.bigquery.project` is set before82 calling `read_gbq`.
Run npx skillmds@latest add googlecloudplatform/zero-copy-ingestion in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Skill: Zero-Copy Data Exploration & Ingestion It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
GoogleCloudPlatform (@googlecloudplatform) published this skill. Their other Agent Skills are listed on their SkillMD profile.