Bird
0
0

Given this model contract snippet in schema.yml:

medium📝 Predict Output Q4 of 15
dbt - Governance and Collaboration
Given this model contract snippet in schema.yml:
models:
  - name: orders
    columns:
      - name: order_id
        type: integer
      - name: order_date
        type: date
What will happen if the orders model returns order_date as a string instead of a date?
Adbt will ignore the type mismatch and run successfully.
Bdbt will automatically cast the string to date.
Cdbt will skip the model execution.
Ddbt will raise a contract validation error during run.
Step-by-Step Solution
Solution:
  1. Step 1: Understand contract validation behavior

    Model contracts validate that output columns match declared types exactly.
  2. Step 2: Analyze the mismatch scenario

    If order_date is returned as string but expected as date, dbt will detect this mismatch and raise an error.
  3. Final Answer:

    dbt will raise a contract validation error during run. -> Option D
  4. Quick Check:

    Type mismatch triggers validation error = C [OK]
Quick Trick: Type mismatches cause validation errors, no automatic casting [OK]
Common Mistakes:
MISTAKES
  • Assuming dbt auto-casts types
  • Thinking dbt ignores contract mismatches
  • Believing model execution is skipped on error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes