bigquery-migration-sql-translator
Translates SQL queries, DDL schemas, and stored procedures from legacy database dialects (Teradata, Oracle, Redshift, Snowflake, SparkSQL, HiveQL) to BigQuery GoogleSQL using the BigQuery Migration Service (BQMS) MCP server
Install / Use
npx skills add google/skills --skill bigquery-migration-sql-translatorInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Data & AnalyticsSupported Platforms
Our assessment of bigquery-migration-sql-translator
bigquery-migration-sql-translator scores 91/100 on our quality scale, 181st of 597 Data & Analytics skills we index (top 31%).
Its SKILL.md is 16 KB long, well organised into 13 sections and no 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 39 days ago, so bigquery-migration-sql-translator 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-sql-translator compared with similar skills
All 4 of these similar skills score higher than bigquery-migration-sql-translator; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| bigquery-migration-sql-translator (this skill)by google | 91 | 20.3k | 39d ago | SKILL.md |
| claude-memby thedotmack | 100 | 109.0k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 107.6k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.5k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.7k | today | CLAUDE.md |
Frequently asked questions
- How do I install bigquery-migration-sql-translator?
- Run
npx skills add google/skills --skill bigquery-migration-sql-translator. The install tabs above show the steps for each supported agent. - Which AI agents does bigquery-migration-sql-translator 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-sql-translator 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-sql-translator still maintained?
- The repository was last updated 39 days ago, so bigquery-migration-sql-translator is actively maintained.
Skill content
View source on GitHubname: bigquery-migration-sql-translator metadata: version: "1.0.2" category: BigDataAndAnalytics publisher: google description: >- Translates SQL queries, DDL schemas, and stored procedures from legacy database dialects (Teradata, Oracle, Redshift, Snowflake, SparkSQL, HiveQL) to BigQuery GoogleSQL using the BigQuery Migration Service (BQMS) MCP server. Use when translating legacy SQL queries, migrating schemas or metadata zip archives, or configuring BigQuery Migration Service (BQMS) YAML translation settings. Don't use for executing BigQuery queries or managing datasets and tables (use bigquery-basics), diagnosing runtime job errors (use bigquery-troubleshooting), or tuning slot reservations (use bigquery-optimization).
BigQuery Migration Service (BQMS) SQL Translator
The BigQuery Migration Service (BQMS) translates legacy database SQL scripts, queries, and schemas into GoogleSQL. This skill coordinates translation workflows, Cloud Storage staging, compiler error triage, and YAML configuration.
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
Before translating queries or schemas, verify the following prerequisites:
-
Google Cloud SDK & Project Setup: Ensure the Google Cloud SDK is installed, verify that your Google Cloud project has an active Cloud Billing account attached, and select the target project:
gcloud config set project {project_id} -
Enable the API: Enable the BigQuery Migration API (
bigquerymigration.googleapis.com) in your Google Cloud project:gcloud services enable bigquerymigration.googleapis.com -
Required IAM Roles: Verify that your identity or service account has:
roles/mcp.toolUser(MCP Tool User)roles/bigquerymigration.editor(Migration Workflow Editor)- For batch translation,
roles/storage.objectViewerandroles/storage.objectCreator(orroles/storage.objectAdmin) on the Cloud Storage buckets that hold the input and output files.
-
MCP Server Connection: If BigQuery Migration Service (BQMS) tools (e.g.
translate_query,translate_batch_queries) are not present in your active tool list, configure the remote BigQuery Migration Service (BQMS) MCP server. For setup instructions across clients (Claude, Cursor, Gemini CLI, VS Code), see mcp_config.md. -
Cost & Cloud Storage Cleanup: Review Google Cloud Pricing for Cloud Storage and BigQuery usage details. After completing a batch migration, clean up temporary staged input and output folders in Cloud Storage:
gcloud storage rm -r gs://{bucket}/{folder} -
Translation Tracking: For batch translations, and for queries that need more than one translation iteration, keep a translation tracker (e.g.
translation_tracker.md) to document goals, planned steps, and progress. After each translation, record one row with this template:Iteration | Status | Total Errors | Correctness Errors | Completeness Errors | Compatibility Errors | Key Actions / Transformations --------- | ------ | ------------ | ------------------ | ------------------- | -------------------- | -----------------------------
A single query that translates cleanly on the first attempt needs no tracker: report its translation ID and logs in your response.
Workflow Selection
Choose the workflow based on your migration scope:
- Interactive Translation (Single Query): Best for ad-hoc queries, exploratory testing, dialect syntax comparison, or quick error debugging.
- Batch Translation (Multiple Files & Cloud Storage): Use for more than
one file or a directory, including SQL embedded in application code (extract
it into
.sqlfiles first). For multi-file Python codebases containing embedded SQL, use python_embedded_sql_migrator_template.py to extract queries into staged files and re-inject translated SQL. Batch translation is faster and cheaper than translating files one by one, and it resolves cross-file dependencies, so it usually gives better results. Runtranslate_batch_querieson the staged files first; usetranslate_queryonly afterwards if needed to debug a specific statement fromtranslation_report.csv.
1. Interactive Translation Workflow
Use the interactive workflow to translate a single query string, inspect compiler logs, and iteratively resolve issues.
Steps
-
Submit Query (
translate_query): Calltranslate_querywithprojectNumber,location,inputQuery,sourceDialect, andtargetDialect(BigQuery). Include optional parameters:metadataFilePath: Cloud Storage URI to a metadata zip file (gs://.../metadata.zip) for schema resolution.translationConfigs: Inline YAML configurations (e.g. object renaming, schema redirection, optimizer rules). Show the YAML you used in your response so the user can reuse it (e.g. in batch translation).
-
Poll Status (
get_translation): If the returnedtranslation_stateisRUNNINGorPENDING, pollget_translationusing thetranslationID,projectNumber, andlocationuntiltranslation.stateisSUCCEEDEDorFAILED, at the interval given in the BigQuery Migration Service (BQMS) MCP tool descriptions. While the job runs, do work that doesn't need the result (e.g. read the dialect gotchas reference). -
Inspect Output & Logs:
- Examine
translated_queryfor the converted GoogleSQL. - Review each entry in
translation_logs: inspectseverity(ERROR,WARNING),category(e.g.RelationNotFound), andeffect(CORRECTNESS,COMPLETENESS,COMPATIBILITY). - Check the SQL itself, not only the logs: BigQuery Migration Service
(BQMS) emits
ERROR_TYPE(...)for types it cannot map, sometimes with no log entry. Treat anyERROR_TYPEor inline error comment as an error, and when a BigQuery project is available, dry-run the result (bq query --dry_run --use_legacy_sql=false). ANot foundormust be qualified with a dataseterror still means the SQL is syntactically valid; the referenced objects just don't exist in BigQuery yet. Say so and move on, even if the error suggests a fix: don't stub tables or change the SQL orbqflags to get past it. - A
NoSuchFunctionerror means BigQuery Migration Service (BQMS) copied that call unchanged, sometimes with the function name in backticks. Treat it as untranslated even if BigQuery has a function with that name: a dry run that stops at missing tables doesn't check it. - If the source dialect has a gotchas reference (see Dialect-Specific Gotchas), read it and check the output for the patterns it lists. Some semantic differences produce no log entry and still pass a dry run.
- Examine
-
Iterate Until Clean: If the logs contain errors or warnings, the translated SQL contains
ERROR_TYPEor inline error comments, the dry run fails, or the output matches a dialect gotcha, resolve the issues as described in Resolving Translation Issues and re-translate. -
Explain & Compare Differences (
explain_translation): When requested to explain a translation, compare syntax differences, or understand how specific query logic was converted, callexplain_translationwithtranslation(the translation ID),projectNumber, andlocation. This returns a structured explanation of the query's purpose and a detailed breakdown of syntax, function, and behavioral differences between the source query and the translated GoogleSQL. The explanation doesn't validate the output, so check the translation as in step 3 rather than relying on it.
2. Batch Translation Workflow
Batch translation handles multiple files staged in Cloud Storage. It resolves
cross-file dependencies and produces a consolidated translation summary report
(translation_report.csv).
Steps
-
Stage Input Files to Cloud Storage: Upload the raw SQL files, configuration files (
*.config.yaml), and any metadata file from the local workspace to a Cloud Storage input folder:gcloud storage cp input/*.sql gs://my-bucket/migration/input/ gcloud storage cp *.config.yaml gs://my-bucket/migration/input/Note: Do not pass configuration file paths in tool parameters if those files are already located inside
sourceBaseUri.Use new, empty Cloud Storage input and output folders for each run (e.g. with a timestamp suffix). Stage only files from the local workspace or generated in this run. Never reuse or copy inputs, DDL, or outputs that are already in a bucket from earlier runs: they may come from different inputs or settings.
-
Initiate Batch Translation:
- Translating SQL Queries (
translate_batch_queries): Calltranslate_batch_querieswithprojectNumber,location,sourceDialect,targetDialect,sourceBaseUri, andtargetBaseUri. - Translating Metadata Zip Files (
translate_metadata): To aid batch translation by generating target BigQuery DDL schema definitions from an extracted database metadata zip file (metadata.zipfrom Teradata, Oracle, etc.), calltranslate_metadataspecifyingsourceBaseUri(Cloud Storage URI tometadata.zip) andtargetBaseUri(destination Cloud Storage folder).
- Translating SQL Queries (
-
Poll Completion (
fetch_batch_translation): Poll using the returned workflow ID untiltranslation.stateisSUCCEEDEDorFAILED, at the interval given in the BigQuery Migration Service (BQMS) MCP tool descriptions. -
Retrieve & Inspect Outputs: Download the generated files from
translation.target_base_uri:gcloud storage cp -r gs://my-bucket/migration/output/ ./local_output/Locate and inspect
report/translation_report.csvto review all warnings, errors, and line-level diagnostics. Then scan the generated.sqlfiles forERROR_TYPE(...)and inline error comments, which the report can miss, and dry-run the generated SQL when a BigQuery project is available (handleNot founderrors as in the interactive workflow). Check the output for the patterns in the source dialect's gotchas reference, if one exists. Resolve or clearly report every remaining issue; do not describe the output as clean until this check passes. -
Iterate Until Clean: Resolve the issues found in step 4 as described in Resolving Translation Issues, and re-run from step 1 with the changed inputs.
-
Post-processing (Final Step Only): Only after resolving every compiler error that re-translation can fix, execute any application-level post-processing (e.g. AST re-injection) to restore host source files. effect_correctness.md lists the errors that may remain when re-injecting embedded SQL.
Resolving Translation Issues
Both workflows resolve issues the same way:
- Identify the Effect (
CORRECTNESS,COMPLETENESS,COMPATIBILITY) of each issue, and resolve them in order of compiler phase dependencies:CORRECTNESS(parse errors) first, thenCOMPLETENESS(missing objects), thenCOMPATIBILITY(unsupported featu
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
109.0kPersistent 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
Agent-Reach
107.6kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
78.5kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.7kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
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.
