Practical beginner guide to ISO 8000-61 Data Quality Engineering—implementing Completeness, Syntactic Accuracy, Semantic Accuracy, Consistency, Uniqueness, and Timeliness checks in SQL and Delta pipelines.
Imagine running a bottled water factory without automated quality sensors: - Some bottles leave with no label (missing data) - Some say "Exp: Banana-99" instead of a date (syntax error) - Some claim a 500 ml bottle weighs 4,000 kg (business impossibility) - Two bottles somehow carry the exact same serial number (duplicate ID)
Wait until a supermarket calls to complain? That ruins trust! Instead, factories install automated pass/quarantine gates right on the conveyor belt.
ISO 8000-61 is the international framework defining those exact data conveyor-belt rules across 6 measurable dimensions.
ISO 8000-61:2016 (Data quality management: Process reference model) and DAMA-DMBOK2 formalize enterprise quality evaluation across 6 core dimensions:
SELECT COUNT(*) AS missing_keys
FROM silver.deposits_return
WHERE account_id IS NULL OR TRIM(account_id) = '';SELECT COUNT(*) AS invalid_currency_format
FROM silver.deposits_return
WHERE NOT REGEXP_LIKE(currency_code, '^[A-Z]{3}$');SELECT COUNT(*) AS impossible_balances
FROM silver.deposits_return
WHERE ledger_balance < -5000.00 OR ledger_balance > 1000000000.00;SELECT COUNT(*) AS inconsistent_dates
FROM silver.shipments
WHERE delivered_date < shipped_date;SELECT account_id, COUNT(*) AS dup_count
FROM silver.deposits_return
GROUP BY account_id
HAVING COUNT(*) > 1;SELECT MAX(event_timestamp) AS latest_event
FROM silver.deposits_return
HAVING MAX(event_timestamp) < CURRENT_TIMESTAMP() - INTERVAL 24 HOURS;Not every error deserves halting the whole company pipeline at 3 AM! Choose the right response per severity:
| Strategy | Behavior on Failing Row | When to Use |
|---|---|---|
| WARN / LOG | Allow row through, increment monitoring metric + Slack alert. | Non-critical optional fields (e.g., marketing_referrer missing). |
| QUARANTINE (Drop & Route) | Move failing row cleanly to quarantine.bad_rows with failure_reason, pass healthy rows forward! | Single corrupt webhook records (email = 'invalid', malformed JSON). |
| FAIL JOB (Circuit Breaker) | Abort entire pipeline before overwriting Gold (FAIL UPDATE). Keeps yesterday's valid Gold snapshot intact! | Duplicate Primary Keys, orphan revenue accounts, > 5% sudden row-count drop (Volume Drift)! |
CREATE OR REFRESH STREAMING TABLE silver_certified_deposits (
CONSTRAINT valid_account_pk EXPECT (account_id IS NOT NULL) ON VIOLATION FAIL UPDATE,
CONSTRAINT valid_currency EXPECT (currency_code RLIKE '^[A-Z]{3}$') ON VIOLATION DROP ROW,
CONSTRAINT valid_overdraft EXPECT (ledger_balance >= -5000.00) ON VIOLATION FAIL UPDATE
)
AS SELECT * FROM STREAM(bronze_raw_deposits);IS NOT NULL check passes 100%! Always add a completeness volume check (today_rows >= 0.5 * 7day_avg_rows).Test your understanding of the concepts covered in this lesson.
A junior analyst added a naive filter WHERE ledger_balance >= 0, assuming bank accounts can never have negative balances. This accidentally threw away millions of pounds in legitimate authorized customer overdrafts. In financial data engineering, an overdraft is a valid negative balance up to the agreed credit limit (e.g. down to -£5,000.00). We need an accurate data quality assertion rule.