Challenge - 5 Problems
Source YAML Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the effect of this source configuration in YAML?
Given this YAML snippet configuring a source in dbt, what will be the resulting source name and table name in dbt's catalog?
dbt
version: 2 sources: - name: sales_data tables: - name: transactions description: "Table of all sales transactions" identifier: sales_txn
Attempts:
2 left
💡 Hint
Look at the 'identifier' field in the table configuration.
✗ Incorrect
In dbt source configuration, the 'name' under 'sources' is the source name. The 'name' under 'tables' is the logical table name used in dbt, but the actual physical table name in the database is set by 'identifier'. Here, 'identifier: sales_txn' means the physical table is 'sales_txn'.
❓ data_output
intermediate1:30remaining
How many sources and tables are defined in this YAML?
Count the total number of sources and tables defined in this YAML configuration.
dbt
version: 2
sources:
- name: marketing
tables:
- name: campaigns
- name: leads
- name: finance
tables:
- name: invoices
- name: payments
- name: refundsAttempts:
2 left
💡 Hint
Count the top-level source entries and sum their tables.
✗ Incorrect
There are two sources: 'marketing' and 'finance'. Marketing has 2 tables, finance has 3 tables, total 5 tables.
🔧 Debug
advanced2:00remaining
Identify the error in this source YAML configuration
What error will dbt raise when parsing this YAML source configuration?
dbt
version: 2
sources:
- name: customer_data
tables:
- name: customers
identifier: cust
- identifier: ordersAttempts:
2 left
💡 Hint
Check if every table entry has a 'name' key.
✗ Incorrect
Each table in 'tables' must have a 'name' key. The second table entry lacks 'name', causing a parsing error.
🧠 Conceptual
advanced1:30remaining
What is the purpose of the 'loaded_at_field' in a source configuration?
In dbt source YAML configuration, what does the 'loaded_at_field' property specify?
Attempts:
2 left
💡 Hint
Think about tracking freshness of source data.
✗ Incorrect
'loaded_at_field' tells dbt which column holds the timestamp of the last data load, useful for freshness checks.
🚀 Application
expert2:30remaining
Which YAML snippet correctly configures a source with a schema override and a freshness policy?
Select the YAML snippet that correctly sets a source named 'web_logs' with a schema 'analytics', a table 'events', and a freshness policy of 24 hours.
Attempts:
2 left
💡 Hint
Freshness is set per table, schema is set per source.
✗ Incorrect
In dbt, 'schema' is set at the source level. 'freshness' is configured per table inside the tables list. Option A correctly places freshness under the table 'events'.