Week 146 - Data Quality & Monitoring

This week, you’ll explore Data Metric Functions (DMFs) in Snowflake—a feature designed to help monitor and enforce data quality. The idea is simple: rather than manually inspecting your data for issues, you define expectations that describe what “good” data looks like. Snowflake will then evaluate those expectations (hint) against your table and flag any violations.

Setup Code

create or replace schema week_146;

create table week_146.data_table (id int);

INSERT INTO week_146.data_table (id) 
VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);

This week’s setup is simple: you’ll create a table containing values from 1 to 10. Nothing fancy.

However, there’s a catch: we were expecting the data to have a maximum value of 8.

Your task is to use Data Metric Functions in Snowflake to define and apply this expectation, so that Snowflake flags the current data as non-conforming.

Once the expectation is in place, use Snowflake’s system functions and metadata tables to surface the failure.

Your final result should resemble something like this:

Previous
Previous

Week 147 - Cortex (AI / ML)

Next
Next

Week 145 - Cortex (AI / ML)