- Categories:
SYSTEM$EVALUATE_DATA_QUALITY_EXPECTATIONS¶
Returns the expectations for associations between data metric functions (DMFs) and a table, including whether an expectation is currently violated.
Syntax¶
Arguments¶
REF_ENTITY_NAME => 'object'Name of the table or view that has at least one DMF with one or more expectations. Must be fully qualified.
SKIP_SUSPENDED_DMF => { TRUE | FALSE }If set to TRUE, the function doesn’t return expectations that are defined for associations between the
objectand suspended DMFs. A suspended DMF doesn’t run on the object’s specified schedule.Default: TRUE
WITHIN_GROUP_VALUES => 'json_object'For an association created with a WITHIN GROUP clause, a JSON object that maps grouping column names to the specific group values to evaluate. For example:
'{"REGION": "US", "PRODUCT_CATEGORY": "Electronics"}'. If you omit this argument, expectations are evaluated across all groups.Only string and numeric values are supported in the JSON object.
For more information, see Apply data quality checks by group.
Returns¶
Returns a table with the following columns:
Column |
Data type |
Description |
|---|---|---|
|
VARCHAR |
Name of the database that contains the DMF. |
|
VARCHAR |
Name of the schema that contains the DMF. |
|
VARCHAR |
Name of the DMF. |
|
VARCHAR |
Name that the user assigned the expectation when adding it to the association between the DMF and the table. |
|
NUMBER |
System-generated identifier. |
|
VARCHAR |
Boolean expression of the expectation. See Defining what meets the expectation. |
|
ARRAY |
Columns with which the DMF is associated. |
|
VARIANT |
The result of the DMF evaluation. |
|
BOOLEAN |
If TRUE, the expectation was violated. An expectation is violated when the |
|
VARIANT |
For an expectation defined on an association created with a WITHIN GROUP clause, a JSON object that identifies the group this row
corresponds to. Each key is a grouping column name and each value is that column’s value for the group, for example
For more information, see Apply data quality checks by group. |
Access control privileges¶
A role used to execute this operation must have the following privileges at a minimum:
Privilege |
Object |
Notes |
|---|---|---|
SELECT |
Table or view |
|
USAGE |
Data metric function (DMF) |
Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Example¶
Return the expectations for the associations between DMFs and table t1. The DMFs are executed to determine if the expectations are
currently violated.