Which two mechanisms allow dbt to write DRY code by reusing logic, preventing writing the same code multiple times?
Choose 2 options.
Given this dbt_project.yml:
name: "jaffle_shop"
version: "1.0.0"
config-version: 2
profile: "snowflake"
model-paths: ["models"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
target-path: "target"
clean-targets:
- "logs"
- "target"
- "dbt_modules"
- "dbt_packages"
models:
jaffle_shop:
orders:
materialized: table
When executing a dbt run your models build as views instead of tables:
19:36:14 Found 1 model, 0 tests, 0 snapshots, 0 analyses, 179 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics
19:36:16 Concurrency: 1 threads (target='default')
19:36:17 Finished running 1 view model in 3.35s.
19:36:17 Completed successfully
19:36:17 Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1
Which could be a root cause of why the model was not materialized as a table?
The target-path is incorrectly configured.
You want to add new columns to an existing model with a new version.
What will trigger warnings for removal of older model versions?
Choose 1 option.
You have written this new agg_completed_tasks dbt model:
with tasks as (
select * from {{ ref('stg_tasks') }}
)
select
user_id,
{% for task in tasks %}
sum(
case
when task_name = '{{ task }}' and state = 'completed'
then 1
else 0
end
) as {{ task }}_completed
{% endfor %}
from tasks
group by 1
The dbt model compiles to:
with tasks as (
select * from analytics.dbt_user.stg_tasks
)
select
user_id,
from tasks
group by 1
The case when statement did not populate in the compiled SQL. Why?
The dbt_project.yml file contains this configuration:
models:
+grants:
select: ['reporter']
How can you grant access to the object in the data warehouse to both reporter and bi?
Which two are true about version controlling code with Git?
Choose 2 options.
Examine how freshness is defined at the database level:
- name: raw
database: raw
freshness: # default freshness
warn_after: {count: 12, period: hour}
error_after: {count: 24, period: hour}
loaded_at_field: _etl_loaded_at
How can one table from the source raw be excluded from source freshness?
Consider these SQL and YAML files for the model model_a:
models/staging/model_a.sql
{{ config(
materialized = "view"
) }}
with customers as (
...
)
dbt_project.yml
models:
my_new_project:
+materialized: table
staging:
+materialized: ephemeral
Which is true about model_a? Choose 1 option.
Options:
Match the desired outcome to the dbt command or argument.
