Bird
0
0

You wrote this dbt model config for Redshift:

medium📝 Debug Q6 of 15
dbt - Performance Optimization
You wrote this dbt model config for Redshift:
config(
  materialized='table',
  sort_keys=['date', 'user_id']
)
But the model fails to build. What is the likely cause?
Asort_keys should be specified inside partition_by
Bsort_keys should be a dictionary, not a list
CThe materialized type must be incremental to use sort_keys
Dsort_keys is not a valid config option in dbt for Redshift
Step-by-Step Solution
Solution:
  1. Step 1: Check valid config options for Redshift in dbt

    Redshift uses dist and sort (list of columns), not sort_keys.
  2. Step 2: Identify the error

    Using sort_keys causes a syntax error because it is not recognized.
  3. Final Answer:

    sort_keys is not a valid config option in dbt for Redshift -> Option D
  4. Quick Check:

    Invalid config option causes build failure [OK]
Quick Trick: Use sort=['date', 'user_id'] for Redshift sort keys [OK]
Common Mistakes:
MISTAKES
  • Using sort_keys instead of sort
  • Assuming sort_keys must be a dict
  • Thinking materialization type affects sort usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes