Skip to main content

data_quality

Creates, updates, deletes, gets or lists a data_quality resource.

Overview

Namedata_quality
TypeResource
Iddatabricks_workspace.dataquality.data_quality

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
object_idstringThe UUID of the request object. It is ``schema_id`` for ``schema``, and ``table_id`` for ``table``. Find the ``schema_id`` from either: 1. The `schema_id <https://docs.databricks.com/api/workspace/schemas/get#schema_id>`__ of the ``Schemas`` resource. 2. In `Catalog Explorer <https://docs.databricks.com/aws/en/catalog-explorer/>`__ &gt; select the ``schema`` &gt; go to the ``Details`` tab &gt; the ``Schema ID`` field. Find the ``table_id`` from either: 1. The `table_id <https://docs.databricks.com/api/workspace/tables/get#table_id>`__ of the ``Tables`` resource. 2. In `Catalog Explorer <https://docs.databricks.com/aws/en/catalog-explorer/>`__ &gt; select the ``table`` &gt; go to the ``Details`` tab &gt; the ``Table ID`` field.
anomaly_detection_configobjectAnomaly Detection Configuration, applicable to ``schema`` object types.
data_profiling_configobjectData Profiling Configuration, applicable to ``table`` object types. Exactly one ``Analysis Configuration`` must be present.
object_typestringThe type of the monitored object. Can be one of the following: ``schema`` or ``table``.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectobject_type, object_id, deployment_nameRead a data quality monitor on a Unity Catalog object.
listselectdeployment_namepage_size, page_token(Unimplemented) List data quality monitors.
createinsertdeployment_name, monitorCreate a data quality monitor on a Unity Catalog object. The caller must provide either
updateupdateobject_type, object_id, update_mask, deployment_name, monitorUpdate a data quality monitor on Unity Catalog object.
deletedeleteobject_type, object_id, deployment_nameDelete a data quality monitor on Unity Catalog object.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
object_idstringThe UUID of the request object. It is schema_id for schema, and table_id for table. Find the schema_id from either: 1. The schema_id <https://docs.databricks.com/api/workspace/schemas/get#schema_id>__ of the Schemas resource. 2. In Catalog Explorer <https://docs.databricks.com/aws/en/catalog-explorer/>__ > select the schema > go to the Details tab > the Schema ID field. Find the table_id from either: 1. The table_id <https://docs.databricks.com/api/workspace/tables/get#table_id>__ of the Tables resource. 2. In Catalog Explorer <https://docs.databricks.com/aws/en/catalog-explorer/>__ > select the table > go to the Details tab > the Table ID field.
object_typestringThe type of the monitored object. Can be one of the following: schema or table.
update_maskstringThe field mask to specify which fields to update as a comma-separated list. Example value: data_profiling_config.custom_metrics,data_profiling_config.schedule.quartz_cron_expression
page_sizeinteger
page_tokenstring

SELECT examples

Read a data quality monitor on a Unity Catalog object.

SELECT
object_id,
anomaly_detection_config,
data_profiling_config,
object_type
FROM databricks_workspace.dataquality.data_quality
WHERE object_type = '{{ object_type }}' -- required
AND object_id = '{{ object_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Create a data quality monitor on a Unity Catalog object. The caller must provide either

INSERT INTO databricks_workspace.dataquality.data_quality (
monitor,
deployment_name
)
SELECT
'{{ monitor }}' /* required */,
'{{ deployment_name }}'
RETURNING
object_id,
anomaly_detection_config,
data_profiling_config,
object_type
;

UPDATE examples

Update a data quality monitor on Unity Catalog object.

UPDATE databricks_workspace.dataquality.data_quality
SET
monitor = '{{ monitor }}'
WHERE
object_type = '{{ object_type }}' --required
AND object_id = '{{ object_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND monitor = '{{ monitor }}' --required
RETURNING
object_id,
anomaly_detection_config,
data_profiling_config,
object_type;

DELETE examples

Delete a data quality monitor on Unity Catalog object.

DELETE FROM databricks_workspace.dataquality.data_quality
WHERE object_type = '{{ object_type }}' --required
AND object_id = '{{ object_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;