Bird
0
0

This incremental model SQL:

medium📝 Debug Q7 of 15
dbt - Incremental Models
This incremental model SQL:
SELECT * FROM source WHERE event_date > (SELECT MAX(event_date) FROM target)

causes missing late-arriving data updates. Why?
AIt causes syntax error due to subquery
BIt excludes late data with event_date less than max date in target
CIt duplicates all records in target
DIt updates all records regardless of date
Step-by-Step Solution
Solution:
  1. Step 1: Analyze filter condition

    The filter only selects rows with event_date greater than max in target.
  2. Step 2: Understand late data effect

    Late data with older event_date is excluded and never updated.
  3. Final Answer:

    It excludes late data with event_date less than max date in target -> Option B
  4. Quick Check:

    Filter excludes late data = It excludes late data with event_date less than max date in target [OK]
Quick Trick: Filter by max date excludes late-arriving data [OK]
Common Mistakes:
MISTAKES
  • Assuming subquery causes syntax error
  • Thinking it duplicates records
  • Believing it updates all records

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes