Challenge - 5 Problems
dbt-utils Master Tester
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of dbt_utils.equality test on two tables
Given two tables
table_a and table_b with identical columns and data, what will be the result of running the dbt_utils.equality test comparing these tables?dbt
select * from {{ dbt_utils.equality('table_a', 'table_b') }}
Attempts:
2 left
💡 Hint
Think about what happens when two tables have exactly the same data.
✗ Incorrect
The dbt_utils.equality test compares two tables row by row. If they are identical, the test passes with no failures.
❓ data_output
intermediate2:00remaining
Result of dbt_utils.unique_combination_of_columns test
You run the
dbt_utils.unique_combination_of_columns test on a table with columns user_id and order_id. The table has duplicate rows where user_id and order_id repeat. What will the test output show?dbt
select * from {{ dbt_utils.unique_combination_of_columns('orders', ['user_id', 'order_id']) }}
Attempts:
2 left
💡 Hint
The test finds duplicates in the specified columns.
✗ Incorrect
The test returns rows where the combination of specified columns is not unique, showing duplicates.
🔧 Debug
advanced2:00remaining
Identify the error in dbt_utils.not_null test usage
What error will occur when running this test?
select * from {{ dbt_utils.not_null('customers', 'customer_id, email') }}dbt
select * from {{ dbt_utils.not_null('customers', 'customer_id, email') }}
Attempts:
2 left
💡 Hint
Check the expected data type for the columns parameter.
✗ Incorrect
The columns parameter must be a list of strings, not a single string with commas.
🚀 Application
advanced2:00remaining
Using dbt_utils.expression_is_true to test a condition
You want to test that all rows in the
sales table have amount > 0. Which is the correct way to write this test using dbt_utils.expression_is_true?Attempts:
2 left
💡 Hint
The expression parameter must be a string representing the condition.
✗ Incorrect
The expression must be passed as a string. Option C correctly passes 'amount > 0' as a string.
🧠 Conceptual
expert3:00remaining
Understanding the output of dbt_utils.surrogate_key test
You use
dbt_utils.surrogate_key macro to generate a surrogate key from columns first_name and last_name. What is the expected output type and behavior of this macro?Attempts:
2 left
💡 Hint
Think about what a surrogate key is and how hashing helps.
✗ Incorrect
The surrogate_key macro creates a hash of the specified columns to produce a unique string key.