bigquery-migration-sql-translator
Skill này làm gì
Skill này giúp chuyển cơ sở dữ liệu từ các hệ thống cũ sang BigQuery. Skill dành cho các đội di chuyển truy vấn, định nghĩa bảng và script lên Google Cloud.
Khi nào nên dùng
- ✓Khi bạn chuyển truy vấn SQL từ Teradata, Oracle, Redshift, Snowflake hoặc Hive sang BigQuery.
- ✓Khi bạn cần di chuyển schema cơ sở dữ liệu hoặc kho lưu trữ metadata sang BigQuery.
- ✓Khi bạn cần thiết lập cài đặt dịch hàng loạt cho một lần di chuyển BigQuery.
Liên kết skill
https://github.com/google/skills/blob/main/skills/cloud/bigquery-migration-sql-translator/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chuyển các stored procedure và truy vấn Oracle của tôi sang SQL BigQuery, và cho tôi biết những phần nào không dịch sạch.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill dùng BigQuery Migration Service để dịch script và schema. Skill đặt tạm file trong Cloud Storage và giúp bạn sửa các lỗi biên dịch mà nó báo cáo.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.comRequired 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, s
Câu hỏi thường gặp
Tôi có cần bật API không?
Có. Phải bật BigQuery Migration API trong dự án trước khi dịch.
Skill hỗ trợ những hệ thống cũ nào?
Skill liệt kê Teradata, Oracle, Redshift, Snowflake, SparkSQL và HiveQL.
Skill có cần quyền bổ sung không?
Có. Skill cần vai trò MCP tool user và migration editor, cùng các vai trò lưu trữ cho các tác vụ hàng loạt.
Chi tiết
Mô tả gốc của tác giả
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).
repo: google/skills
Độ phổ biến
- Sao GitHub
- 22k
- Vị trí xếp hạng
- #10227
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
finding-google-skills
22kGiúp agent của bạn tìm hướng dẫn Google phù hợp cho việc thiết lập, như hosting, cơ sở dữ liệu, lưu trữ, đăng nhập hoặc phục vụ mô hình AI.
gcloud
22kGiúp agent của bạn viết và kiểm tra các lệnh gcloud của Google Cloud, tra cứu cú pháp chính xác trước khi chạy bất cứ thứ gì để không đoán các flag.
google-cloud-recipe-auth
22kHướng dẫn agent của bạn qua quản lý danh tính và quyền truy cập của Google Cloud, gồm cách con người và dịch vụ đăng nhập và những quyền họ nhận được.
google-cloud-recipe-onboarding
22kHướng dẫn một lập trình viên mới qua các bước đầu tiên trên Google Cloud, gồm chọn dự án, liên kết thanh toán và triển khai tài nguyên đầu tiên.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.