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-exporterInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Data & AnalyticsSupported Platforms
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.
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.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| bigquery-migration-data-exporter (this skill)by google | 90 | 20.3k | 2mo ago | SKILL.md |
| claude-memby thedotmack | 100 | 119.6k | today | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 2mo ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 2mo ago | SKILL.md |
| prospectingby coreyhaines31 | 100 | 62.2k | 5d ago | SKILL.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.
Skill content
View source on GitHubname: 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/metadatadirectory (local path or Cloud Storage URI). It automatically discovers all physical tables and target BigQuery logical types frommetadata/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
-
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} -
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 -
Authentication & Required Identity and Access Management (IAM) Roles: Authenticate with
gcloud auth loginandgcloud auth application-default login(or setGOOGLE_APPLICATION_CREDENTIALSfor service account authentication). Verify that your identity or service account hasroles/storage.objectViewer(Storage Object Viewer) on any Cloud Storage bucket holding input metadata. Creating a staging bucket requiresroles/storage.admin(Storage Admin) on the Google Cloud project, and deleting staged files requiresroles/storage.objectAdmin(Storage Object Admin) on the staging bucket. -
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 -
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 tous-central1unless 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 withgcloud 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). -
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-integrationflag, which adds aSTORAGE_INTEGRATIONclause to each generatedCOPY INTOstatement. 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:
sourceName: Fully qualified source table name.columns: Source data types, precision, scale, and BigQuery target types.- Table versus view: A config with neither
externalTableNamenorexternalTableDdlPathdescribes a view, which is recreated as a SQL view and isn't exported. The Databricks generator also honors an explicitTableTypefield 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:
-
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'; -
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 colforMAP(and forSTRUCT/ARRAYwhen targetingJSONorSTRING; native passthroughcolwhen targetingRECORD/ARRAY);CAST(col AS STRING) AS colforVARIANT/JSON/INTERVAL. - Teradata:
CAST(col AS CLOB) AS col. - Oracle:
JSON_SERIALIZE(col RETURNING CLOB) AS colfor 21c+ nativeJSON, andXMLSERIALIZE(CONTENT col AS CLOB) AS colforXMLTYPE. - PostgreSQL:
CAST(col AS TEXT) AS colforJSON,JSONB,XML,UUID,INET,CIDR,MACADDR,INTERVAL,BIT, andARRAY.
- Snowflake:
-
Decimals, Numbers, Integers & Floats:
NUMBER(p, s)/DECIMAL(p, s)/NUMERIC(p, s)withs > 0→CAST(col AS DECIMAL(p, s)) AS col(orCAST(col AS NUMBER(p, s)) AS colin Oracle, orCAST(col AS NUMERIC(p, s)) AS colin PostgreSQL).- Unbounded or unconstrained
NUMBER/NUMBER(*)/NUMERIC/DECIMAL→CAST(col AS DECIMAL(38, 9)) AS colin Snowflake and Teradata,CAST(col AS NUMBER(38, 9)) AS colin Oracle, orCAST(col AS NUMERIC(38, 9)) AS colin PostgreSQL (supports<= 29integer digits and9fractional digits by default; override scale in Teradata, Oracle, and PostgreSQL by using--unbounded-number-scale); PostgreSQLMONEY→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 coland the ANSINUMBER(38)aliasesINT/INTEGER→CAST(col AS NUMBER(38, 0)) AS col. Scale-0 decimals with aTargetTypeofINT64project as 64-bit integers; the mapping references list whichNUMBER(p, 0)/DECIMAL(p, 0)precisions become 64-bit integers by default.- Databricks / Snowflake
FLOAT/REAL→CAST(col AS DOUBLE) AS col; PostgreSQLREAL/DOUBLE PRECISION→CAST(col AS DOUBLE PRECISION) AS col; OracleBINARY_FLOAT/BINARY_DOUBLE/FLOAT(p)→CAST(col AS BINARY_DOUBLE) AS col(widens to 64-bit IEEE-754FLOAT64).
-
Temporal (
DATE,TIME,TIMESTAMP,TIMESTAMP_NTZ,TIMESTAMP WITH TIME ZONE):- Snowflake:
CAST(col AS TIMESTAMP_NTZ(6)) AS colandCAST(CONVERT_TIMEZONE('UTC', col) AS TIMESTAMP_NTZ(6)) AS col. - Databricks / Spark SQL:
CAST(col AS TIMESTAMP) AS colwhen targetingTIMESTAMP, or leaveTIMESTAMP_NTZuncast when targeting BigQueryDATETIME.TIMESTAMP_NTZtoTIMESTAMPcasts (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, andCAST((col AT TIME ZONE 'GMT') AS TIME(6)) AS col. - Oracle:
CAST(col AS TIMESTAMP(6)) AS colforDATEandTIMESTAMP(p)(orTRUNC(col) AS colwhenDATEexplicitly targets BigQueryDATE),CAST(SYS_EXTRACT_UTC(col) AS TIMESTAMP(6)) AS colforTIMESTAMP WITH TIME ZONE, andCAST(SYS_EXTRACT_UTC(CAST(col AS TIMESTAMP WITH TIME ZONE)) AS TIMESTAMP(6)) AS colforTIMESTAMP WITH LOCAL TIME ZONE(UTC, whatever the session time zone). - PostgreSQL:
CAST(col AS TIME(6)) AS colforTIMEandTIMETZ,CAST(col AS TIMESTAMP(6) WITHOUT TIME ZONE) AS colforTIMESTAMP [WITHOUT TIME ZONE], andCAST(col AS TIMESTAMP(6) WITH TIME ZONE) AS colforTIMESTAMPTZ/TIMESTAMP WITH TIME ZONE.
- Snowflake:
-
Fixed-Width Character Padding (
CHAR(n)/NCHAR(n)/BPCHAR/GRAPHIC(n)):TRIM(TRAILING FROM col) AS col(Teradata) orRTRIM(col) AS col(Oracle and PostgreSQL) to strip fixed-width trailing pad spaces. -
Explicit Target Types: A BigQuery
TargetTypefrom the BQMS config (for example a schema override toINT64,NUMERIC,DATE, orTIMESTAMP) 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, andBYTESin Oracle and Teradata (text columns stay text, binary columns stay bytes, and numeric or datetime columns keep their type);BOOLin Teradata and Oracle;TIMEin Oracle and Databricks;DATEon Oracle columns other thanDATE/TIMESTAMP; and targets other than numeric orSTRINGon DatabricksDECIMALcolumns. Ifbq loadreports a type mismatch, edit the template's# CUSTOMIZE: Custom Type Projectionshook.
[!IMPORTANT] Always cons
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
119.6kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
prospecting
62.2kWhen the user wants to find and qualify prospects for outbound, or asks who to target first, which signal to prioritize, or where to spot buyers with the problem: buying signals, enrichment, verification, account research.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
