Перейти к содержанию
Skillpedia
Базы данных22k · #10252

dbt-sf-to-bq-translator

Что он делает

Скилл переносит модели данных dbt из Snowflake в BigQuery в Google Cloud. Он нужен командам данных, которые переносят конвейеры dbt и хотят, чтобы результат соответствовал стандартам Google.

Когда использовать

  • ✓Когда вы переносите конвейер или модели dbt из Snowflake в BigQuery.
  • ✓Когда нужно перевести SQL dbt из Snowflake в SQL BigQuery с сохранением шаблонов.
  • ✓Когда план миграции отслеживает прогресс в файле задач, и вы хотите, чтобы каждый шаг записывался по ходу работы.

Ссылка на скилл

https://github.com/google/skills/blob/main/skills/cloud/dbt-sf-to-bq-translator/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/google/skills/blob/main/skills/cloud/dbt-sf-to-bq-translator/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Переведи мои модели dbt из Snowflake в этой папке в SQL для BigQuery и записывай прогресс в мой файл задач миграции.”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

Скилл компилирует SQL Snowflake, защищает макросы dbt Jinja и переводит запросы с помощью сервиса миграции BigQuery. Затем он применяет стандарты Google, например заголовки авторских прав и явное приведение типов.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

dbt Snowflake to BigQuery Translator

You are responsible for:

  1. Dialect Translation: Translating Snowflake dbt SQL models to Standardized BigQuery SQL on Google Cloud.
  2. Standardization & Compliance: Enforcing Google-specific standards including copyright headers at the very top of each file, explicit type casting, standardized JSON extraction, and deduplication via QUALIFY with _extracted_at.
  3. Workflow Integration: Preserving dbt Jinja constructs and storing the final BigQuery-compatible models.

Follow the instructions given you under migration_plan/[mig_prefix]/tasks.md. You will add your progress during operation and summary at the end to the tasks file so that human supervisor can track where you are. You recover from errors by checking the tasks file.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:dbt-sf-to-bq-translator)" and append agent-skills/1.0 (skill:dbt-sf-to-bq-translator) to User-Agent headers.

Prerequisites & Environment Setup

Before starting the translation, ensure your Google Cloud environment is properly configured:

  1. Google Cloud SDK: Install the Google Cloud SDK if not already installed.
  2. Authentication: Authenticate your CLI session:
    gcloud auth login
    gcloud auth application-default login
    
  3. Project Configuration: Set your active Google Cloud project:
    gcloud config set project {project_id}
    
  4. Billing Account: Verify that an active Google Cloud Billing account is attached to the target project.
  5. Enable Required APIs: Ensure BigQuery, Migration, and Storage services are enabled:
    gcloud services enable bigquerymigration.googleapis.com storage.googleapis.com bigquery.googleapis.com
    
  6. Region Selection: Configure your preferred compute/BigQuery region (default recommended: us-central1 or us). See Google Cloud Locations:
    gcloud config set compute/region us-central1
    

Steps

  • Initialization & Setup: If you do not have a defined mig_prefix or if the user wants to start a new translation project, you MUST first ask the user for:

    1. Migration Project Name (e.g. my_migration_project).
    2. Input directory containing Snowflake SQL files.
    3. Output directory where BigQuery SQL files should be saved.
    4. Cloud Storage bucket name for staging translation assets.
    5. Google Cloud region (e.g. us or eu).
    6. (Optional) Local path to a directory or .zip file containing source database metadata (such as columns.csv or tables.csv). Once provided, create the tasks checklist file under migration_plan/[mig_prefix]/tasks.md with unchecked tasks representing the migration steps.
  • Automated Execution via Bundled Scripts: Execute the deterministic end-to-end migration using the bundled translation script scripts/bulk_translate_via_gcloud.py:

    python3 scripts/bulk_translate_via_gcloud.py \
      --input {input_dir} \
      --output {output_dir} \
      --bucket {gcs_bucket} \
      --location {region} \
      [--metadata {metadata_path}] \
      [--array-cast-mode {array_cast_mode}] \
      [--struct-columns {struct_columns}]
    
    Flag Default Description
    --input (Required) Local directory containing source Snowflake dbt .sql and .yml files.
    --output (Required) Target directory for translated BigQuery dbt .sql and .yml files.
    --bucket (Required) Cloud Storage bucket name used to stage translation inputs and outputs.
    --location us Google Cloud region for BigQuery Translation Service execution (e.g., us, eu).
    --metadata None Optional path to a directory or .zip archive containing source tables.csv and columns.csv.
    --array-cast-mode array_string Target conversion for BQMS ARRAY<JSON> casts. Use array_string (ARRAY<STRING>) by default; use string (STRING), json_extract_string_array, or preserve as escape hatches when required by the source table schema.
    `--struct-columns
Частые вопросы

Сохраняются ли шаблоны dbt?

Да. Он сохраняет конструкции Jinja и подготавливает итоговые модели для BigQuery.

Где фиксируется прогресс?

В файле задач миграции, который он обновляет по ходу работы.

Охватывает ли он обычные запросы BigQuery?

Нет. Он предназначен для миграции моделей dbt из Snowflake, а не для общих запросов к BigQuery.

Подробности

Оригинальное описание автора

Translates Snowflake dbt SQL models to Standardized BigQuery SQL. Handles SQL compilation, Jinja macro placeholder masking, BigQuery Translation Service migration workflows, AST-based config transformations, explicit type casting, JSON extraction standardization, and deduplication. Use when migrating Snowflake dbt pipelines or models to BigQuery on Google Cloud. Don't use for generic BigQuery queries or non-Snowflake SQL migrations.

repo: google/skills

Популярность

Звёзды на GitHub
22k
Место в рейтинге
#10252
Лицензия
Apache-2.0
Обновлён
02.11.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы