Complete the code to define a custom singular test that checks if a column has no null values.
select count(*) from [1] where {{column_name}} is null having count(*) > 0
In dbt, this refers to the current model or table being tested, which is used in singular tests.
Complete the code to define the test's SQL file with the correct Jinja syntax for a singular test.
select count(*) from [1] where {{column_name}} is null having count(*) > 0
The this variable is used in singular tests to refer to the current model or table.
Fix the error in the singular test SQL by completing the missing Jinja variable to refer to the column name.
select count(*) from {{this}} where [1] is null having count(*) > 0
The variable column_name is passed to the singular test and used to refer to the column being tested.
Fill both blanks to create a singular test that checks if the count of nulls in a column is zero.
select count(*) as num_nulls from [1] where [2] is null having count(*) > 0
The table is referenced by this and the column by column_name in singular tests.
Fill all three blanks to write a singular test that returns zero if no nulls exist in the column.
select case when count(*) = 0 then 0 else 1 end as test_result from [1] where [2] is null having [3] > 0
The test checks the current model (this) for nulls in column_name and uses count(*) to compare the number of nulls.