Bird
0
0

In dbt-utils, what is the primary output of the surrogate_key macro when applied to a list of columns?

easy📝 Conceptual Q1 of 15
dbt - Packages and Reusability
In dbt-utils, what is the primary output of the surrogate_key macro when applied to a list of columns?
AA concatenated string of the column values separated by underscores
BA hashed string that uniquely identifies the combination of the specified columns
CA numeric sequence generated for each row
DA JSON object containing the column names and values
Step-by-Step Solution
Solution:
  1. Step 1: Understand surrogate_key purpose

    The surrogate_key macro creates a unique identifier for a combination of columns.
  2. Step 2: How it generates the key

    It uses a hashing function to generate a fixed-length string that uniquely represents the input columns.
  3. Final Answer:

    A hashed string that uniquely identifies the combination of the specified columns -> Option B
  4. Quick Check:

    Hashing ensures uniqueness and fixed length [OK]
Quick Trick: surrogate_key creates a hash, not concatenation [OK]
Common Mistakes:
MISTAKES
  • Assuming it concatenates columns directly
  • Thinking it generates numeric sequences
  • Believing it outputs JSON objects

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes