Bird
0
0

You want to create a fan-in model that merges data from two sources with overlapping columns but different naming conventions. How should you handle this in dbt?

hard🚀 Application Q9 of 15
dbt - Advanced Patterns

You want to create a fan-in model that merges data from two sources with overlapping columns but different naming conventions. How should you handle this in dbt?

AJoin tables without renaming columns and rely on default column names
BUse <code>union all</code> without aligning column names
CUse <code>select</code> statements to rename columns to a common name before joining
DLoad only one source to avoid conflicts
Step-by-Step Solution
Solution:
  1. Step 1: Identify column name conflicts

    Overlapping columns with different names cause confusion when merging data.
  2. Step 2: Rename columns to common names

    Using select with aliases standardizes column names before joining or unioning.
  3. Final Answer:

    Use select statements to rename columns to a common name before joining -> Option C
  4. Quick Check:

    Rename columns to align schemas before merging [OK]
Quick Trick: Rename columns to match before merging sources [OK]
Common Mistakes:
MISTAKES
  • Joining without renaming causes ambiguous columns
  • Unioning without aligned columns causes errors
  • Ignoring one source to avoid conflicts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes