
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?
You run this command:
dbt build --select "source_status:fresher+" --state path/to/prod/artifacts
Which two need to happen before it can be executed successfully?
Choose 2 options.