SkillAgentSearch skills...

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)

Install / Use

npx skills add google/skills --skill bigquery-migration-data-exporter

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

90/100

Supported Platforms

Universal

Our assessment of bigquery-migration-data-exporter

bigquery-migration-data-exporter scores 90/100 on our quality scale, 270th of 602 Data & Analytics skills we index (top 45%).

Its SKILL.md is 25 KB long, well organised into 24 sections with 7 code examples: a thorough specification that gives an agent plenty to work with.

With 20,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
18/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so bigquery-migration-data-exporter is actively maintained.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

bigquery-migration-data-exporter compared with similar skills

All 4 of these similar skills score higher than bigquery-migration-data-exporter; compare them before choosing.

SkillScoreStarsUpdatedFormat
bigquery-migration-data-exporter (this skill)by google9020.3k2mo agoSKILL.md
claude-memby thedotmack100119.6ktodayCLAUDE.md
algorithmic-artby anthropics100177.9k2mo agoSKILL.md
pptxby anthropics100177.9k2mo agoSKILL.md
prospectingby coreyhaines3110062.2k5d agoSKILL.md

Frequently asked questions

How do I install bigquery-migration-data-exporter?
Run npx skills add google/skills --skill bigquery-migration-data-exporter. The install tabs above show the steps for each supported agent.
Which AI agents does bigquery-migration-data-exporter work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is bigquery-migration-data-exporter safe to use?
It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is bigquery-migration-data-exporter still maintained?
The repository was last updated about 2 months ago, so bigquery-migration-data-exporter is actively maintained.

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.

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 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). Review Google Cloud 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 Teradata/Oracle/PostgreSQL NUMBER/NUMERIC scale truncation, PostgreSQL MONEY locale currency formatting, Oracle DATE time-of-day components, or timestamp nanosecond ticks).

To ensure zero type drift and clean BigQuery ingestion, apply type-aware projections guided by the target format and dialect specifications in the references/ directory. While Parquet is the standard and recommended format for BigQuery batch ingestion due to columnar compression and strict typing, the export structure adapts based on target format requirements.

For Parquet data exports, the core rules are summarized below; the mapping references listed after them hold the full per-dialect type matrices:

  1. Session Parameters (Snowflake):

    ALTER SESSION SET TIME_OUTPUT_FORMAT = 'HH24:MI:SS.FF6';
    ALTER SESSION SET TIMESTAMP_NTZ_OUTPUT_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF6';
    ALTER SESSION SET TIMESTAMP_TZ_OUTPUT_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF6 TZHTZM';
    
  2. Semi-Structured / JSON (VARIANT, OBJECT, STRUCT, MAP, ARRAY, JSON, JSONB, XMLTYPE, XML, UUID, INET):

    • Snowflake: TO_VARCHAR(col) AS col.
    • Databricks / Spark SQL: TO_JSON(col) AS col for MAP (and for STRUCT/ARRAY when targeting JSON or STRING; native passthrough col when targeting RECORD/ARRAY); CAST(col AS STRING) AS col for VARIANT/JSON/INTERVAL.
    • Teradata: CAST(col AS CLOB) AS col.
    • Oracle: JSON_SERIALIZE(col RETURNING CLOB) AS col for 21c+ native JSON, and XMLSERIALIZE(CONTENT col AS CLOB) AS col for XMLTYPE.
    • PostgreSQL: CAST(col AS TEXT) AS col for JSON, JSONB, XML, UUID, INET, CIDR, MACADDR, INTERVAL, BIT, and ARRAY.
  3. Decimals, Numbers, Integers & Floats:

    • NUMBER(p, s) / DECIMAL(p, s) / NUMERIC(p, s) with s > 0 → CAST(col AS DECIMAL(p, s)) AS col (or CAST(col AS NUMBER(p, s)) AS col in Oracle, or CAST(col AS NUMERIC(p, s)) AS col in PostgreSQL).
    • Unbounded or unconstrained NUMBER / NUMBER(*) / NUMERIC / DECIMAL → CAST(col AS DECIMAL(38, 9)) AS col in Snowflake and Teradata, CAST(col AS NUMBER(38, 9)) AS col in Oracle, or CAST(col AS NUMERIC(38, 9)) AS col in PostgreSQL (supports <= 29 integer digits and 9 fractional digits by default; override scale in Teradata, Oracle, and PostgreSQL by using --unbounded-number-scale); PostgreSQL MONEY → CAST(col AS NUMERIC(38, 2)) AS col.
    • TINYINT / BYTEINT / SMALLINT / INT / INTEGER / BIGINT / SERIAL → CAST(col AS BIGINT) AS col. In Oracle, SMALLINT → CAST(col AS NUMBER(19, 0)) AS col and the ANSI NUMBER(38) aliases INT / INTEGER → CAST(col AS NUMBER(38, 0)) AS col. Scale-0 decimals with a TargetType of INT64 project as 64-bit integers; the mapping references list which NUMBER(p, 0) / DECIMAL(p, 0) precisions become 64-bit integers by default.
    • Databricks / Snowflake FLOAT / REAL → CAST(col AS DOUBLE) AS col; PostgreSQL REAL / DOUBLE PRECISION → CAST(col AS DOUBLE PRECISION) AS col; Oracle BINARY_FLOAT / BINARY_DOUBLE / FLOAT(p) → CAST(col AS BINARY_DOUBLE) AS col (widens to 64-bit IEEE-754 FLOAT64).
  4. Temporal (DATE, TIME, TIMESTAMP, TIMESTAMP_NTZ, TIMESTAMP WITH TIME ZONE):

    • Snowflake: CAST(col AS TIMESTAMP_NTZ(6)) AS col and CAST(CONVERT_TIMEZONE('UTC', col) AS TIMESTAMP_NTZ(6)) AS col.
    • Databricks / Spark SQL: CAST(col AS TIMESTAMP) AS col when targeting TIMESTAMP, or leave TIMESTAMP_NTZ uncast when targeting BigQuery DATETIME. TIMESTAMP_NTZ to TIMESTAMP casts (and back) use the session time zone, so run the scripts in a UTC session (see the [Databricks reference][databricks_map]).
    • Teradata: CAST(col AS TIMESTAMP(6)) AS col, CAST((col AT TIME ZONE 'GMT') AS TIMESTAMP(6)) AS col, and CAST((col AT TIME ZONE 'GMT') AS TIME(6)) AS col.
    • Oracle: CAST(col AS TIMESTAMP(6)) AS col for DATE and TIMESTAMP(p) (or TRUNC(col) AS col when DATE explicitly targets BigQuery DATE), CAST(SYS_EXTRACT_UTC(col) AS TIMESTAMP(6)) AS col for TIMESTAMP WITH TIME ZONE, and CAST(SYS_EXTRACT_UTC(CAST(col AS TIMESTAMP WITH TIME ZONE)) AS TIMESTAMP(6)) AS col for TIMESTAMP WITH LOCAL TIME ZONE (UTC, whatever the session time zone).
    • PostgreSQL: CAST(col AS TIME(6)) AS col for TIME and TIMETZ, CAST(col AS TIMESTAMP(6) WITHOUT TIME ZONE) AS col for TIMESTAMP [WITHOUT TIME ZONE], and CAST(col AS TIMESTAMP(6) WITH TIME ZONE) AS col for TIMESTAMPTZ / TIMESTAMP WITH TIME ZONE.
  5. Fixed-Width Character Padding (CHAR(n) / NCHAR(n) / BPCHAR / GRAPHIC(n)): TRIM(TRAILING FROM col) AS col (Teradata) or RTRIM(col) AS col (Oracle and PostgreSQL) to strip fixed-width trailing pad spaces.

  6. Explicit Target Types: A BigQuery TargetType from the BQMS config (for example a schema override to INT64, NUMERIC, DATE, or TIMESTAMP) wins over the source-type defaults above so the Parquet column matches the BigQuery DDL. Cross-type overrides that a template doesn't convert keep the default projection: STRING, JSON, and BYTES in Oracle and Teradata (text columns stay text, binary columns stay bytes, and numeric or datetime columns keep their type); BOOL in Teradata and Oracle; TIME in Oracle and Databricks; DATE on Oracle columns other than DATE / TIMESTAMP; and targets other than numeric or STRING on Databricks DECIMAL columns. If bq load reports a type mismatch, edit the template's # CUSTOMIZE: Custom Type Projections hook.

[!IMPORTANT] Always cons

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars20.3k
CategoryData
Updated2mo ago
Forks1.7k

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions