Custom SQL check (query + threshold)¶
custom - Column-level - Common column checks
Runs a custom SQL query and compares the result against a threshold - the escape hatch for anything not covered by a built-in check.
Parameters¶
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
query |
str | none | Yes | The SQL query to execute; must return a single value. |
operator |
str | 'eq' |
No | Comparison operator applied to the query result. One of: lt, lte, gt, gte, eq, neq. |
threshold |
float | 0.0 |
No | The value to compare the query result against. |
description |
str | 'Custom SQL check' |
No | Human-readable description of what the check validates. |
YAML example¶
checks:
- name: example_custom
check_type: custom
table_name: schema.table
column_name: example_column
parameters:
query: <query>
operator: eq
threshold: 0.0
description: Custom SQL check
See YAML check format for the full field reference.