Bird
0
0

Why does this dbt model fail during profiling?

medium📝 Debug Q7 of 15
dbt - Performance Optimization

Why does this dbt model fail during profiling?

select * from customers where customer_id = 'abc'

Given that customer_id is an integer column.

ASyntax error in SELECT *
BMissing GROUP BY clause
CType mismatch: comparing integer column to string literal
DNo error, query runs fine
Step-by-Step Solution
Solution:
  1. Step 1: Analyze data types in WHERE clause

    customer_id is integer but compared to string 'abc', causing type mismatch.
  2. Step 2: Understand effect on query execution

    Type mismatch causes query failure during execution or profiling.
  3. Final Answer:

    Type mismatch: comparing integer column to string literal -> Option C
  4. Quick Check:

    Type mismatch = query fail [OK]
Quick Trick: Match data types in WHERE clauses to avoid errors [OK]
Common Mistakes:
MISTAKES
  • Ignoring data type mismatch
  • Thinking GROUP BY is needed
  • Assuming SELECT * causes error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes