Which checks run
The call runs the checks on the tables you name:- Monitors with the schedule set to
on demand. In YAML, this isschedule: ondemand. - SQL tests with the schedule set to
On demand.
Create an API client
Create an with theTrigger Data Checks scope (SCOPE_DATACHECKS_TRIGGER). Exchange its credentials for an access token as described in Fetching Access Token.
Trigger the checks
SendPOST /api/datachecks/scheduler/v1/trigger with the tables in entity_ids. This example runs the checks on one Snowflake table:
Each warehouse has its own identifier type, for example bigquery_table or databricks_table. See the API reference for the fields of each.
Coalesce Quality runs up to 10 checks at the same time. The response has one result for each check on the tables you named, including checks that did not start in time.
Results
Each result has a status:
The status follows the severity of the check, as its run in Coalesce Quality does. A check with severity Info informs: when it finds a problem, it answers
DATACHECK_STATUS_PASSED, so a pipeline that stops on DATACHECK_STATUS_FAILED continues. Set the severity to Warning or Error for a check that must stop the pipeline.
A monitor is skipped when it has already checked the current time interval. For example, a monitor with a daily time partition checks one day at a time. If you call twice on the same day, the second call skips it. A monitor is also skipped when its warehouse integration is disabled.
A monitor result has one prediction for each segment, with the measured value and the expected value. A SQL test result has rows_count, the number of rows the test query returned.
Keep the warehouse cost down
How you call the API decides how often your warehouse runs. Snowflake is the example here. The same applies to other warehouses that bill by uptime. For the resume and minimum billing, see What monitoring costs in your warehouse.- Send the tables in one call. Put every table a pipeline step updated in the
entity_idsof one call, not one call per table. Each call can resume the warehouse, and Snowflake bills at least 60 seconds for each resume. 50 calls with one table can mean 50 resumes for the same work as one call with 50 tables. - Split very large batches. A call keeps starting new checks for 3 minutes after it begins. Checks already running then finish. Checks that have not started by then do not run, and come back with status
DATACHECK_STATUS_ERRORand the messageitem was not executed due to context cancellation. If a batch has more checks than finish in that time, split it into several calls before you send it. A second call for the same tables runs all their SQL tests again, including the ones that already finished. - Mind the time between calls. If the time between calls is shorter than the
AUTO_SUSPENDof the warehouse, the warehouse never suspends and bills continuously, whatever the checks cost. - Mind the concurrency. A Snowflake warehouse has a default concurrency level of 8 (
MAX_CONCURRENCY_LEVEL), and queries beyond it queue. Coalesce Quality runs up to 10 checks of one call at the same time, so on a warehouse that also runs other work, checks queue behind it. Queued time is billed uptime. - Choose the warehouse. Checks run on the warehouse of the warehouse integration, the same one its metadata collection uses every 30 minutes. A warehouse that is already running for other work causes no resumes of its own. But the checks then run at its size and compete with your transformation jobs. Snowflake credits per hour double with each size step, so the same query costs more on a larger warehouse. A small dedicated warehouse pays for its resumes, bills less per second and does not compete with other work.
Run a SQL test again
To run an earlier SQL test execution again with the same time placeholder values, sendPOST /api/datachecks/scheduler/v1/trigger/sql-test-run-again with its execution_id. You can use the execution_id from a result of the trigger call. See Run a test again.
Calls that come too close together
If you send a call for the same set of tables within a few seconds of the previous one, the call is rejected with HTTP status429 and the message request throttled, retry after N seconds. Wait the given number of seconds, then retry.