What if you could catch hidden data problems with just one simple test?
Why Custom singular tests in dbt? - Purpose & Use Cases
Imagine you have a big data table and you want to check if a specific rule is true, like "Are all user emails unique?" or "Is the total sales number above zero?" Doing this by looking at raw data or writing many manual queries can be confusing and slow.
Manually writing queries for each check takes a lot of time and can easily lead to mistakes. You might forget to check some important rules or write inconsistent queries. It's hard to keep track of all these checks as your data grows.
Custom singular tests let you write one clear, reusable test that checks exactly what you want. You can run these tests automatically every time your data changes, so you catch problems early without extra work.
SELECT COUNT(*) FROM users WHERE email IS NULL OR email IN (SELECT email FROM users GROUP BY email HAVING COUNT(*) > 1);tests: - unique_email_check
It makes data quality checks simple, consistent, and automatic, so you trust your data without spending hours on manual queries.
A company uses a custom singular test to ensure their daily sales data always has positive totals before running reports, preventing wrong business decisions.
Manual checks are slow and error-prone.
Custom singular tests automate and simplify data validation.
They help keep data trustworthy and save time.