← 返回命令列表

Linux command

dbt 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Initialize a new dbt

dbt init [project_name]

Run all models

dbt run

Run specific model

dbt run --select [model_name]

Test data quality

dbt test

Generate documentation

dbt docs generate

Serve documentation

dbt docs serve

Build

dbt build

Load seed CSV

dbt seed

Compile SQL without

dbt compile

Retry

dbt retry

说明

dbt (data build tool) is a transformation workflow tool that enables data analysts and engineers to transform data in their warehouse using SQL. It follows software engineering practices like version control, testing, and documentation for data transformations. dbt works with your existing data warehouse (Snowflake, BigQuery, Redshift, PostgreSQL, etc.) and manages the T in ELT (Extract, Load, Transform). Models are defined as SQL SELECT statements that dbt materializes as tables or views. The tool provides dependency management between models, automated testing with schema tests and custom tests, documentation generation, and incremental processing for efficient updates of large datasets.

参数

--select, -s _MODEL_
Select specific models to run.
--exclude _MODEL_
Exclude specific models from run.
--target, -t _TARGET_
Target profile to use.
--profiles-dir _DIR_
Directory containing profiles.yml.
--project-dir _DIR_
Directory containing dbt_project.yml.
--full-refresh
Rebuild incremental models from scratch.
--threads _N_
Number of threads to run models in parallel.
--vars _JSON_
Pass variables as JSON.
--help
Display help information.

FAQ

What is the dbt command used for?

dbt (data build tool) is a transformation workflow tool that enables data analysts and engineers to transform data in their warehouse using SQL. It follows software engineering practices like version control, testing, and documentation for data transformations. dbt works with your existing data warehouse (Snowflake, BigQuery, Redshift, PostgreSQL, etc.) and manages the T in ELT (Extract, Load, Transform). Models are defined as SQL SELECT statements that dbt materializes as tables or views. The tool provides dependency management between models, automated testing with schema tests and custom tests, documentation generation, and incremental processing for efficient updates of large datasets.

How do I run a basic dbt example?

Run `dbt init [project_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --select, -s _MODEL_ do in dbt?

Select specific models to run.