---
title: "Set is not empty"
description: "You expect the query to return at least one row"
url: "https://docs.justcat.it/reference/tests/expectations/set-is-not-empty/"
---
# Set is not empty


## Example

A typical smoke test: after a release or a data load, a table must hold at least one row.


**Properties**



Suite
: Smoke Tests

Name
: Table Dimension.Customer is loaded

Data Source
: DWH

Query
: SELECT * FROM Dimension.Customer

Expectation
: set is not empty





**YAML**


```yaml
Tests:
- Suite: Smoke Tests
  Name: Table Dimension.Customer is loaded
  Data Source: DWH
  Query: SELECT * FROM Dimension.Customer
  Expectation: set is not empty
```




## Queries

One: `Data source` and `Query` (`First data source` and `First query` work too). A `Second data source` or `Second query` on the test is an error — the test ends with `Error` before anything runs.

## Result

If no rows are returned, the result is `Failed`.

If at least one row is returned, the result is `Passed`.

If the underlying provider returns an exception, the result is `Error`.

## Properties it reads

None beyond the query. The message never contains data, so `Maximum errors logged` has nothing to do here.

## Remarks

CAT reads one row and closes the connection to the provider; it never looks at the second row.

> **🐱:** CAT really only checks whether the result contains at least one row and does not examine it in any way. So if your query is `SELECT COUNT(*) FROM SomeTable` and the expectation is `set is not empty`, the result will always be `Passed`, because one row (with the number of records) is always returned.



Only the query costs time; on a large table restrict it — `SELECT TOP(1) …` in SQL Server, `LIMIT 1` in PostgreSQL, and so on.

## Related

* [Set is empty](https://docs.justcat.it/reference/tests/expectations/set-is-empty/ "Set is empty") — the opposite check.

