Categories:

LOCAL schema , Table functions

DATA_QUALITY_MONITORING_RESULTS

Returns a row for each data metric function assigned to the specified object, which includes the evaluation result and other metadata of the data metric function on the object.

See also:

DATA_QUALITY_MONITORING_RESULTS view (LOCAL view)

Syntax

DATA_QUALITY_MONITORING_RESULTS(
  REF_ENTITY_NAME => '<string>' ,
  REF_ENTITY_DOMAIN => '<string>'
  )

Arguments

REF_ENTITY_NAME => 'string'

The name of the table object on which the data metric function is set.

  • The entire object name must be enclosed in single quotes.
  • If the object name is case-sensitive or includes any special characters or spaces, double quotes are required to process the case/characters. The double quotes must be enclosed within the single quotes, such as '"<table_name>"'.
REF_ENTITY_DOMAIN => 'string'

The object type on which the data metric function is set.

If the object is a kind of table, use 'TABLE' as the argument value.

If the object is a view or materialized view, use 'VIEW' as the argument value.

For a list of supported object types on which a data metric function can be set, see Supported table kinds.

Returns

The function returns the following columns:

Column nameData typeDescription
scheduled_timeTIMESTAMP_LTZThe time the DMF is scheduled to run based on the schedule that you set for the table or view.
change_commit_timeTIMESTAMP_LTZ

The time the DMF trigger operation occurred, or None if the DMF is not scheduled to run by a trigger operation.

For information about the trigger operation, see Adjust the schedule for DMFs.

measurement_timeTIMESTAMP_LTZThe time at which the metric was evaluated.
table_idNUMBERInternal/system-generated identifier of the table that the DMF is associated with.
table_nameVARCHARName of the table that the DMF is associated with.
table_schemaVARCHARName of the schema that contains the table that the DMF is associated with.
table_databaseVARCHARName of the database that contains the table that the DMF is associated with.
metric_idNUMBERInternal/system-generated identifier of the DMF.
metric_nameVARCHARName of the DMF.
metric_schemaVARCHARName of the schema that contains the DMF.
metric_databaseVARCHARName of the database that contains the DMF.
metric_return_typeVARCHARReturn type of the DMF.
arguments_idsARRAYArray of the identifiers of the DMF arguments. Array elements are in the same order as the arguments.
arguments_typesARRAY

Array of the domain/type of each DMF argument. Array elements are in the same order as the arguments.

Currently only supports COLUMN type arguments.

arguments_namesARRAY

Array of the names of the DMF arguments. For column arguments, each element is the name of a column. Array elements are in the same order as the arguments.

reference_idVARCHARThe ID to uniquely identify the metric entity reference, known as the association ID.
valueVARIANTThe result of the DMF evaluation.

Access control requirements

To determine which privileges and roles you need to call this function, see Viewing data quality results.

Usage notes

Errors occur if the specified object name does not exist or if the query operator is not authorized to view any data metric function on the object. Unsupported object types listed as the REF_ENTITY_DOMAIN, such as 'stream', also return errors.

Examples

Return a row for each data metric function assigned to the table named my_table:

USE DATABASE SNOWFLAKE;
USE SCHEMA LOCAL;
SELECT *
  FROM TABLE(SNOWFLAKE.LOCAL.DATA_QUALITY_MONITORING_RESULTS(
    REF_ENTITY_NAME => 'my_db.my_schema.my_table',
    REF_ENTITY_DOMAIN => 'table'));