/bigquery-migration-data-exporter
Generates type-safe, schema-aligned database data export SQL files (.sql) for Snowflake, Databricks, Teradata, Oracle, and PostgreSQL directly from BigQuery Migration Service (BQMS) translation_output/metadata configs, exporting into target file formats (such as Parquet). Use
Claude Code
$ npx -y skills add google/skills --skill bigquery-migration-data-exporter --agent claude-code
Codex
$ npx skills add google/skills --skill bigquery-migration-data-exporter -a codex -y
Cursor
$ npx skills add google/skills --skill bigquery-migration-data-exporter -a cursor -y
Gemini CLI
$ npx skills add google/skills --skill bigquery-migration-data-exporter -a gemini-cli -y
GitHub Copilot
$ npx skills add google/skills --skill bigquery-migration-data-exporter -a github-copilot -y
OpenCode
$ npx skills add google/skills --skill bigquery-migration-data-exporter -a opencode -y
Windsurf
$ npx skills add google/skills --skill bigquery-migration-data-exporter -a windsurf -y
SKILL.md
bigquery-migration-data-exporter.SKILL.mdname: bigquery-migration-data-exporter
metadata:
version: "1.0.0"
category: BigDataAndAnalytics
publisher: google
description: >-
Generates type-safe, schema-aligned database data export SQL files (.sql) for
Snowflake, Databricks, Teradata, Oracle, and PostgreSQL directly from
BigQuery Migration Service (BQMS) translation_output/metadata
configs, exporting into target file formats (such as Parquet). Use when
generating source database export SQL scripts for BigQuery ingestion without
connecting to the source database. Don't use for executing SQL against source
databases or streaming/staging exported files, extracting source database
catalog metadata, translating SQL queries or DDL schemas (use
bigquery-migration-sql-translator), loading staged Parquet files into
BigQuery, or running post-migration data validation.
BigQuery Migration Data Exporter
This skill coordinates the generation of type-aware data export SQL scripts (`.sql` files) for source data warehouses (such as Snowflake, Databricks, Teradata, Oracle, and PostgreSQL) into target file formats (such as **BigQuery-aligned Parquet files**), guided by dialect and format specifications in the **`references/`** directory.
All templates in this skill are **pure SQL generators with zero JDBC or database connector dependencies**.
> [!TIP] > Point directly to the BigQuery Migration Service (BQMS) > **`translation_output/metadata`** directory (local path or Cloud Storage URI). > It automatically discovers all physical tables and target BigQuery logical > types from `metadata/config/*.yaml`.
Usage Attribution
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you MUST read and follow the instructions in [Usage Attribution](references/attribution.md).
Before you begin
1. **Google Cloud CLI & Project Setup**: When reading translation outputs or metadata archives from `gs://` Cloud Storage URIs, ensure the [Google Cloud CLI](https://cloud.google.com/sdk/docs/install) is installed, verify that your Google Cloud project has an active Cloud Billing account attached, and configure the target project:
gcloud config set project {project_id}2. **Enable the API**: When reading metadata from Cloud Storage (`gs://`), ask the user before enabling APIs, then enable the Cloud Storage API (`storage.googleapis.com`):
gcloud services enable storage.googleapis.com
3. **Authentication & Required Identity and Access Management (IAM) Roles**: Authenticate with `gcloud auth login` and `gcloud auth application-default login` (or set `GOOGLE_APPLICATION_CREDENTIALS` for service account authentication). Verify that your identity or service account has `roles/storage.objectViewer` (Storage Object Viewer) on any Cloud Storage bucket holding input metadata. Creating a staging bucket requires `roles/storage.admin` (Storage Admin) on the Google Cloud project, and deleting staged files requires `roles/storage.objectAdmin` (Storage Object Admin) on the staging bucket.
4. **Python Environment**: The generator templates require Python 3.9 or later. Ask the user for confirmation before installing Python packages, then install PyYAML in a virtual environment (generator templates have zero JDBC or database connector dependencies):
pip install pyyaml==6.0.2
5. **Region, Cost & Cleanup**: Ask the user for confirmation before creating a new Cloud Storage bucket for staging exported Parquet files (`gcloud storage buckets create gs://{bucket} --location={region}`), and default to `us-central1` unless your target BigQuery dataset uses another region (co-locate buckets with your dataset; see [Google Cloud locations](https://cloud.google.com/about/locations)). Review [Google Cloud Pricing](https://cloud.google.com/pricing) before staging large exports. After BigQuery ingestion, temporary staged Parquet prefixes can be removed with `gcloud storage rm -r gs://{bucket}/{export_prefix}`. This deletion is permanent: run it only after the user explicitly confirms the exact URI, and never with an empty `{export_prefix}` (which would delete every object in the bucket).
6. **Snowflake Storage Integration**: To unload Snowflake tables directly to a private Cloud Storage bucket (`--stage-path 'gcs://...'`), Snowflake requires a [storage integration][snowflake_gcs_integration] that grants its service account access to the bucket. Ask the user for the integration name and pass it with the `--storage-integration` flag, which adds a `STORAGE_INTEGRATION` clause to each generated `COPY INTO` statement. Unloads to a Snowflake stage (for example, `@~/bqms_export/` or a named external stage) don't need this flag.
--------------------------------------------------------------------------------
1. Direct Consumption of Translation Output Metadata
`bigquery-migration-data-exporter` consumes the native BigQuery Migration Service (BQMS) metadata translation output: `translation_output/metadata/config/<database>/<schema>/<table_name>.yaml`
Each configuration file specifies:
1. `sourceName`: Fully qualified source table name. 2. `columns`: Source data types, precision, scale, and BigQuery target types. 3. Table versus view: A config with neither `externalTableName` nor `externalTableDdlPath` describes a view, which is recreated as a SQL view and isn't exported. The Databricks generator also honors an explicit `TableType` field when present.
--------------------------------------------------------------------------------
2. Format-Guided Type-Safe Export Fundamentals
A plain unguided `COPY INTO @stage FROM table` or `SELECT *` often fails during BigQuery ingestion (`bq load`) due to serializer discrepancies (for example, `VARIANT` JSON encoding, `CHAR(n)` fixed-width space padding, unbounded
Read more
name: bigquery-migration-data-exporter metadata: version: "1.0.0" category: BigDataAndAnalytics publisher: google description: >- Generates type-safe, schema-aligned database data export SQL files (.sql) for Snowflake, Databricks, Teradata, Oracle, and PostgreSQL directly from BigQuery Migration Service (BQMS) translation_output/metadata configs, exporting into target file formats (such as Parquet). Use when generating source database export SQL scripts for BigQuery ingestion without connecting to the source database. Don't use for executing SQL against source databases or streaming/staging exported files, extracting source database catalog metadata, translating SQL queries or DDL schemas (use bigquery-migration-sql-translator), loading staged Parquet files into BigQuery, or running post-migration data validation.
BigQuery Migration Data Exporter
This skill coordinates the generation of type-aware data export SQL scripts (`.sql` files) for source data warehouses (such as Snowflake, Databricks, Teradata, Oracle, and PostgreSQL) into target file formats (such as **BigQuery-aligned Parquet files**), guided by dialect and format specifications in the **`references/`** directory.
All templates in this skill are **pure SQL generators with zero JDBC or database connector dependencies**.
> [!TIP] > Point directly to the BigQuery Migration Service (BQMS) > **`translation_output/metadata`** directory (local path or Cloud Storage URI). > It automatically discovers all physical tables and target BigQuery logical > types from `metadata/config/*.yaml`.
Usage Attribution
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you MUST read and follow the instructions in [Usage Attribution](references/attribution.md).
Before you begin
1. **Google Cloud CLI & Project Setup**: When reading translation outputs or metadata archives from `gs://` Cloud Storage URIs, ensure the [Google Cloud CLI](https://cloud.google.com/sdk/docs/install) is installed, verify that your Google Cloud project has an active Cloud Billing account attached, and configure the target project:
gcloud config set project {project_id}2. **Enable the API**: When reading metadata from Cloud Storage (`gs://`), ask the user before enabling APIs, then enable the Cloud Storage API (`storage.googleapis.com`):
gcloud services enable storage.googleapis.com
3. **Authentication & Required Identity and Access Management (IAM) Roles**: Authenticate with `gcloud auth login` and `gcloud auth application-default login` (or set `GOOGLE_APPLICATION_CREDENTIALS` for service account authentication). Verify that your identity or service account has `roles/storage.objectViewer` (Storage Object Viewer) on any Cloud Storage bucket holding input metadata. Creating a staging bucket requires `roles/storage.admin` (Storage Admin) on the Google Cloud project, and deleting staged files requires `roles/storage.objectAdmin` (Storage Object Admin) on the staging bucket.
4. **Python Environment**: The generator templates require Python 3.9 or later. Ask the user for confirmation before installing Python packages, then install PyYAML in a virtual environment (generator templates have zero JDBC or database connector dependencies):
pip install pyyaml==6.0.2
5. **Region, Cost & Cleanup**: Ask the user for confirmation before creating a new Cloud Storage bucket for staging exported Parquet files (`gcloud storage buckets create gs://{bucket} --location={region}`), and default to `us-central1` unless your target BigQuery dataset uses another region (co-locate buckets with your dataset; see [Google Cloud locations](https://cloud.google.com/about/locations)). Review [Google Cloud Pricing](https://cloud.google.com/pricing) before staging large exports. After BigQuery ingestion, temporary staged Parquet prefixes can be removed with `gcloud storage rm -r gs://{bucket}/{export_prefix}`. This deletion is permanent: run it only after the user explicitly confirms the exact URI, and never with an empty `{export_prefix}` (which would delete every object in the bucket).
6. **Snowflake Storage Integration**: To unload Snowflake tables directly to a private Cloud Storage bucket (`--stage-path 'gcs://...'`), Snowflake requires a [storage integration][snowflake_gcs_integration] that grants its service account access to the bucket. Ask the user for the integration name and pass it with the `--storage-integration` flag, which adds a `STORAGE_INTEGRATION` clause to each generated `COPY INTO` statement. Unloads to a Snowflake stage (for example, `@~/bqms_export/` or a named external stage) don't need this flag.
--------------------------------------------------------------------------------
1. Direct Consumption of Translation Output Metadata
`bigquery-migration-data-exporter` consumes the native BigQuery Migration Service (BQMS) metadata translation output: `translation_output/metadata/config/<database>/<schema>/<table_name>.yaml`
Each configuration file specifies:
1. `sourceName`: Fully qualified source table name. 2. `columns`: Source data types, precision, scale, and BigQuery target types. 3. Table versus view: A config with neither `externalTableName` nor `externalTableDdlPath` describes a view, which is recreated as a SQL view and isn't exported. The Databricks generator also honors an explicit `TableType` field when present.
--------------------------------------------------------------------------------
2. Format-Guided Type-Safe Export Fundamentals
A plain unguided `COPY INTO @stage FROM table` or `SELECT *` often fails during BigQuery ingestion (`bq load`) due to serializer discrepancies (for example, `VARIANT` JSON encoding, `CHAR(n)` fixed-width space padding, unbounded
This repository contains Agent Skills for Google products and technologies, including Google Cloud.
Other skills on skills.
More skills from other plugins.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
ask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Questions about bigquery-migration-data-exporter.
- Which coding agents can use bigquery-migration-data-exporter?
- bigquery-migration-data-exporter installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

