본문으로 건너뛰기
Skillpedia
데이터베이스22k · #10252

dbt-sf-to-bq-translator

하는 일

이 스킬은 dbt 데이터 모델을 Snowflake에서 Google Cloud의 BigQuery로 옮깁니다. dbt 파이프라인을 옮기면서 결과물이 Google의 표준을 따르기를 원하는 데이터 팀을 위한 스킬입니다.

사용하는 경우

  • ✓Snowflake dbt 파이프라인이나 모델을 BigQuery로 옮기고 있을 때.
  • ✓Snowflake dbt SQL을 템플릿을 그대로 둔 채 BigQuery SQL로 번역해야 할 때.
  • ✓마이그레이션 계획이 작업 파일에 진행 상황을 기록하고, 각 단계가 실행될 때마다 기록되기를 원할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/cloud/dbt-sf-to-bq-translator/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 폴더의 Snowflake dbt 모델을 BigQuery SQL로 변환하고, 진행 상황을 마이그레이션 작업 파일에 기록해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

Snowflake SQL을 컴파일하고, 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 쿼리도 다루나요?

아닙니다. 일반 BigQuery 쿼리가 아니라 Snowflake dbt 모델 마이그레이션을 위한 것입니다.

상세 정보

작성자의 원본 설명

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
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬