SYSTEM$EVALUATE_DATA_QUALITY_EXPECTATIONS

functionsupportedGovernance (policies, tags, data quality)Enterprise+

docs.snowflake.com ↗

System functionsTable functions

Returns the expectations for associations between data metric functions (DMFs) and a table, including whether an expectation is currently violated. Data Quality Monitoring requires Enterprise Edition. To inquire about upgrading, please contact Snowflake Support.

Syntax

supportedpartialnot supportednot scored

SYSTEM$EVALUATE_DATA_QUALITY_EXPECTATIONS(
  REF_ENTITY_NAME  => '<object>'
  [ , SKIP_SUSPENDED_DMF => { TRUE | FALSE } ]
)

Parameters

NameRequiredDescription
REF_ENTITY_NAME => 'object'requiredName 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 }requiredIf set to TRUE, the function doesn’t return expectations that are defined for associations between the object and suspended DMFs. A suspended DMF doesn’t run on the object’s specified schedule. Default: TRUE

Returns

Returns a table with the following columns:

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.

See also

For expectations defined on an association created with a WITHIN GROUP clause, this function evaluates every group and returns one row per distinct group, with each group identified in the group_by_values output column. To retrieve the underlying rows for a specific group value, use SYSTEM$DATA_METRIC_SCAN, which accepts a WITHIN_GROUP_VALUES argument. For more information, see Apply data quality checks by group. To evaluate expectations and persist the results to the SNOWFLAKE.LOCAL.DATA_QUALITY_MONITORING_RESULTS_RAW event table so that they appear in data quality history, use SYSTEM$EVALUATE_DATA_QUALITY_EXPECTATIONS_PERSIST_RESULT.