Set is not Empty
You expect the query returned at least one row.
This expectation is useful in smoke tests. E.g., after a release or after every data load into DWH you might want to check that a table is not empty - you expect the process loaded at least “something”:
Tests: - Suite: Smoke Tests Name: Table Dimension.Customer is loaded Data Source: DWH Query: SELECT * FROM Dimension.Customer Expectation: set is not empty
If no rows are returned, the result will be
If at least one row is returned, the result will be
If the underlying provider returns an exception, the result will be
When this expectation is veryfied, CAT closes connection to the underlying provider immediately after it receives first results.
SELECT COUNT(*) FROM SomeTableand expectation is
set is not empty, the result will be always
Passed, because one row (with the number of records) is always returned.
And as with any other expectation, if the query runs too long time, consider using some optimization techniques, such as
SELECT TOP(1) in SQL server,
limit 1 in PostgreSQL etc.