Skip to main content

quality_monitors

Operations on a quality_monitors resource.

Overview

Namequality_monitors
TypeResource
Iddatabricks_workspace.unitycatalog.quality_monitors

Fields

NameDatatype
assets_dirstring
baseline_table_namestring
custom_metricsarray
dashboard_idstring
drift_metrics_table_namestring
inference_logobject
latest_monitor_failure_msgstring
monitor_versionstring
notificationsobject
output_schema_namestring
profile_metrics_table_namestring
scheduleobject
slicing_exprsarray
snapshotobject
statusstring
table_namestring
time_seriesobject

Methods

NameAccessible byRequired ParamsDescription
getSELECTtable_name, deployment_nameGets a monitor for the specified table.
createINSERTtable_name, deployment_nameCreates a new monitor for the specified table.
deleteDELETEtable_name, deployment_nameDeletes a monitor for the specified table.
updateUPDATEtable_name, deployment_nameUpdates a monitor for the specified table.

SELECT examples

SELECT
assets_dir,
baseline_table_name,
custom_metrics,
dashboard_id,
drift_metrics_table_name,
inference_log,
latest_monitor_failure_msg,
monitor_version,
notifications,
output_schema_name,
profile_metrics_table_name,
schedule,
slicing_exprs,
snapshot,
status,
table_name,
time_series
FROM databricks_workspace.unitycatalog.quality_monitors
WHERE table_name = '{{ table_name }}' AND
deployment_name = '{{ deployment_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new quality_monitors resource.

/*+ create */
INSERT INTO databricks_workspace.unitycatalog.quality_monitors (
table_name,
deployment_name,
data__skip_builtin_dashboard,
data__warehouse_id,
data__assets_dir,
data__output_schema_name,
data__inference_log,
data__time_series,
data__snapshot,
data__slicing_exprs,
data__custom_metrics,
data__baseline_table_name,
data__schedule,
data__notifications
)
SELECT
'{{ table_name }}',
'{{ deployment_name }}',
'{{ skip_builtin_dashboard }}',
'{{ warehouse_id }}',
'{{ assets_dir }}',
'{{ output_schema_name }}',
'{{ inference_log }}',
'{{ time_series }}',
'{{ snapshot }}',
'{{ slicing_exprs }}',
'{{ custom_metrics }}',
'{{ baseline_table_name }}',
'{{ schedule }}',
'{{ notifications }}'
;

UPDATE example

Updates a quality_monitors resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.quality_monitors
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE table_name = '{{ table_name }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a quality_monitors resource.

/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.quality_monitors
WHERE table_name = '{{ table_name }}' AND
deployment_name = '{{ deployment_name }}';