DBT CERTIFICATION (PREP) QUESTIONS &
ANSWERS
pre-hook - Answer -executed before a model, seed or snapshot is built.
post-hook - Answer -executed after a model, seed or snapshot is built
on-run-start - Answer -executed at the start of dbt run, dbt seed or dbt snapshot
on-run-end - Answer -executed at the end of dbt run, dbt seed or dbt snapshot
T|F Operations are a separate resource in a dbt project. - Answer -False. Operations
are macros that you can run using the run-operation command command.
What are the required properties in defining an exposure? - Answer -Name, Type &
Owner (email)
What are the different values of 'type' property of an exposure? - Answer -dashboard,
notebook, analysis, ml, application
T|F Exposures appear as orange-y nodes in the DAG - Answer -True.
What will command "dbt run -s +exposure:weekly_jaffle_metrics" execute? - Answer -
This will execute all models upstream of the exposure.
On the first run of the "dbt snapshot" command, what is the value of dbt_valid_to for all
records? - Answer -Null
What are the different strategies used in creating a snapshot? - Answer -Timestamp &
Check
What is the required config when a 'check' strategy is used in creating a snapshot? -
Answer -check_cols
When should a check strategy be used when creating a snapshot? - Answer -The
check strategy is useful for tables which do not have a reliable updated_at column.
What is the required config when a 'timestamp' strategy is used in creating a snapshot?
- Answer -updated_at
What are the different snapshot meta fields? - Answer -dbt_valid_from, dbt_valid_to,
dbt_scd_id, dbt_updated_at
, What happens when the 'invalidate_hard_deletes' config is set to 'true' while defining a
snapshot? - Answer -Finds hard deleted records in source, and set dbt_valid_to current
time if no longer exists
T|F Seeds can be configured in the .csv file - Answer -False. Seeds are configured in
your dbt_project.yml
T|F Sources are declared in the dbt_project.yml file. - Answer -False. Sources are
defined in .yml files nested under a sources: key.
How can the landing page of the generated documentation website be customized? -
Answer -By supplying your own docs block called __overview__. i.e. {{ % docs
_overview_ % }} ....... {{ % enddocs % }}
What happens when command 'dbt test --store-failures' is invoked? - Answer -This will
store failures, the location of which can be configured in the dbt_project.yml file.
What is the name of the default schema to store the results of a test failure? - Answer -
dbt_test__audit
The is_incremental() macro will return True if: - Answer -- the destination table already
exists in the database
- dbt is not running in full-refresh mode
- the running model is configured with materialized='incremental'
T|F If a new column is added to an existing incremental model and dbt run is executed,
the column gets added to the target table. - Answer -False. If you add a column to your
incremental model, and execute a dbt run, this column will not appear in your target
table.
{{ config( materialized='incremental', unique_key='date_day', on_schema_change='fail'
)}}
Based on the above config, what happens when a new column is added to the
incremental model? - Answer -Triggers an error message when the source and target
schemas diverge
{{ config( materialized='incremental', unique_key='date_day',
on_schema_change='append_new_columns' )}}
Based on the above config, what happens when a new column is added to the
incremental model? - Answer -Append new columns to the existing table. Note that this
setting does not remove columns from the existing table that are not present in the new
data.
ANSWERS
pre-hook - Answer -executed before a model, seed or snapshot is built.
post-hook - Answer -executed after a model, seed or snapshot is built
on-run-start - Answer -executed at the start of dbt run, dbt seed or dbt snapshot
on-run-end - Answer -executed at the end of dbt run, dbt seed or dbt snapshot
T|F Operations are a separate resource in a dbt project. - Answer -False. Operations
are macros that you can run using the run-operation command command.
What are the required properties in defining an exposure? - Answer -Name, Type &
Owner (email)
What are the different values of 'type' property of an exposure? - Answer -dashboard,
notebook, analysis, ml, application
T|F Exposures appear as orange-y nodes in the DAG - Answer -True.
What will command "dbt run -s +exposure:weekly_jaffle_metrics" execute? - Answer -
This will execute all models upstream of the exposure.
On the first run of the "dbt snapshot" command, what is the value of dbt_valid_to for all
records? - Answer -Null
What are the different strategies used in creating a snapshot? - Answer -Timestamp &
Check
What is the required config when a 'check' strategy is used in creating a snapshot? -
Answer -check_cols
When should a check strategy be used when creating a snapshot? - Answer -The
check strategy is useful for tables which do not have a reliable updated_at column.
What is the required config when a 'timestamp' strategy is used in creating a snapshot?
- Answer -updated_at
What are the different snapshot meta fields? - Answer -dbt_valid_from, dbt_valid_to,
dbt_scd_id, dbt_updated_at
, What happens when the 'invalidate_hard_deletes' config is set to 'true' while defining a
snapshot? - Answer -Finds hard deleted records in source, and set dbt_valid_to current
time if no longer exists
T|F Seeds can be configured in the .csv file - Answer -False. Seeds are configured in
your dbt_project.yml
T|F Sources are declared in the dbt_project.yml file. - Answer -False. Sources are
defined in .yml files nested under a sources: key.
How can the landing page of the generated documentation website be customized? -
Answer -By supplying your own docs block called __overview__. i.e. {{ % docs
_overview_ % }} ....... {{ % enddocs % }}
What happens when command 'dbt test --store-failures' is invoked? - Answer -This will
store failures, the location of which can be configured in the dbt_project.yml file.
What is the name of the default schema to store the results of a test failure? - Answer -
dbt_test__audit
The is_incremental() macro will return True if: - Answer -- the destination table already
exists in the database
- dbt is not running in full-refresh mode
- the running model is configured with materialized='incremental'
T|F If a new column is added to an existing incremental model and dbt run is executed,
the column gets added to the target table. - Answer -False. If you add a column to your
incremental model, and execute a dbt run, this column will not appear in your target
table.
{{ config( materialized='incremental', unique_key='date_day', on_schema_change='fail'
)}}
Based on the above config, what happens when a new column is added to the
incremental model? - Answer -Triggers an error message when the source and target
schemas diverge
{{ config( materialized='incremental', unique_key='date_day',
on_schema_change='append_new_columns' )}}
Based on the above config, what happens when a new column is added to the
incremental model? - Answer -Append new columns to the existing table. Note that this
setting does not remove columns from the existing table that are not present in the new
data.