Bird
0
0

Why is it important to use ref() instead of hardcoding table names when sharing models across teams in dbt?

hard🧠 Conceptual Q10 of 15
dbt - Governance and Collaboration
Why is it important to use ref() instead of hardcoding table names when sharing models across teams in dbt?
AHardcoded names prevent accidental changes
BHardcoding table names improves performance
C<code>ref()</code> is only for internal models, not cross-team sharing
D<code>ref()</code> maintains dependencies and enables automatic recompilation when models change
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of ref() in dbt

    ref() creates model dependencies and ensures dbt knows the relationships.
  2. Step 2: Explain benefits for cross-team sharing

    Using ref() allows automatic recompilation and correct build order when models change, which hardcoding breaks.
  3. Final Answer:

    ref() maintains dependencies and enables automatic recompilation when models change -> Option D
  4. Quick Check:

    ref() manages dependencies correctly [OK]
Quick Trick: Always use ref() to keep model dependencies intact [OK]
Common Mistakes:
MISTAKES
  • Thinking hardcoding is better
  • Believing ref() is only for internal use
  • Ignoring dependency management

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes