dbt-bigquery

Generates, modifies, and validates dbt models and pipelines targeting Google BigQuery.

9|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/jerrylin96/dotgemini --skill dbt-bigquery-jerrylin96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-bigquery
Source: https://github.com/jerrylin96/dotgemini/tree/main/skills/dbt-bigquery
Command: npx skills add https://github.com/jerrylin96/dotgemini --skill dbt-bigquery-jerrylin96

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dbt-bigquery.

What problem does it solve? Building and maintaining dbt pipelines for BigQuery requires deep knowledge of SQL optimization, project configuration, and adapter quirks. This Skill guides an AI agent through creating, modifying, and troubleshooting dbt models with correct BigQuery-specific practices, reducing misconfigurations like missing profiles.yml files and unoptimized SQL. ## Core Features & Use Cases - dbt Project Scaffolding: Initializes new dbt projects with dbt_project.yml, profiles.yml, and proper folder structure under a dedicated directory. - SQL Optimization & Data Cleaning: Automatically applies BigQuery optimization rules (e.g., rewriting IN subqueries to EXISTS) and mandatory data cleaning protocols on every pipeline change. - Troubleshooting & Validation: Compiles projects with dbt compile, runs dbt test, and diagnoses remote orchestration failures (e.g., Cloud Composer DAG errors) via gcloud logging. - Use Case: Ask the agent to add a new staging model to an existing dbt project; it will inspect the DAG, fetch source table schemas with bq CLI, generate the model with a config block and unit tests, and validate everything with dbt compile. ## Quick Start Create a new dbt model in my project that aggregates daily revenue from the raw_orders BigQuery table and validate it compiles.

Frequently Asked Questions about dbt-bigquery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new dbt model for BigQuery?

Define a SQL file under the models/ directory with a config block specifying the materialization, and reference upstream tables using ref() or source() instead of hardcoded names. Then run dbt compile to validate syntax and dependencies before executing.

How do I optimize SQL queries in a dbt BigQuery project?

Apply mandatory rewrites such as replacing WHERE col IN (SELECT ...) with WHERE EXISTS, and prune unused columns with early predicate filtering. Changes like UNION to UNION ALL or APPROX_COUNT_DISTINCT require user confirmation since they trade accuracy for speed.

Why does my dbt pipeline fail with 'Could not find profile named X'?

This error occurs when profiles.yml is missing from the dbt project directory or remote bundle. Ensure profiles.yml exists alongside dbt_project.yml, matches the profile name in the project config, and maps correct BigQuery project, dataset, and location settings.

Does dbt-bigquery support BigLake Iceberg tables with 4-part naming?

The dbt-bigquery adapter is hardcoded to 3-part naming and does not natively support Project.Catalog.Dataset.Table. A workaround concatenates catalog and dataset into the schema field, but this conflicts with standard environment prefixing like generate_schema_name.

Can the agent run dbt run automatically to execute models?

No, dbt run is never executed without explicit user confirmation. The workflow relies on dbt compile and dbt test to validate correctness without side effects, leaving actual execution to the user.