Running the ETL
Introduction
dbt has a built-in orchestrator that allows you to run the ETL. Only enabled models, using the +enabled: true syntax, will be run. As all models are disabled by default, only the models or dashboards you manually enable will be run.
How to run the store
cssXX.dashboards_store project.
BEFORE calling a dbt command from cssXX.dashboards_store, make sure you have activated the Poetry environment by running eval $(poetry env activate) && poetry install from core.dashboards_store.dbt --help or go to the official dbt documentation.The base command to run and test the store is the following:
dbt build
The base command is a faster alternative to manually running the following commands:
dbt compile
dbt seed
dbt run
dbt test
I have special needs
I need to reload the seeds' definitions
Add the --full-refresh option.
dbt build --full-refresh # Build can be replaced by run.
I want to materialize the transformations in an environment other than the default one
If you want to target an environment other than the default target defined in ~/.dbt/profiles.yml, use the --target option. You will need this to materialize the store in production.
dbt build --target prod # Build can be replaced by every other dbt command such as seed or test.
I want to run only a specific SQL file
If you want to only run a specific SQL file, use the --select option.
dbt build --select <sql_file_name> # The name of the model is the name of the file WITHOUT the `.sql` extension.
I want to run only a specific dashboard
If you want to run only the models from a specific mart or dashboard, use the --select +tag:<model> option.
dbt build --select tag:<name of the dashboard> # Where the dashboard name is the same as the one from dbt_project.yml.
core.dashboards_store/dbt_project.yml to find the tag of the model you want to run.About the + selector and the --select statement
--select statement.If you want to run both a model and its upstream dependencies, use the + selector. This is usually required because models depend on seeds and sources.
dbt build --select +tag:<name of the dashboard> # Where the dashboard name is the same as the one from dbt_project.yml.
or
dbt build --select +<model name> # Where the model name is the same as the SQL file name without the extension.
