Data Quality Fundamentals

Define data quality in measurable dimensions, decide where checks belong in a pipeline, and choose between blocking and warning on failures.

Intermediate · about 3 hours · difficulty 2/5

Learn first: ETL vs ELT and Load Patterns

Data quality is not a vague feeling; it is a set of properties you can measure and test. Trust in a data team is built or lost on this.

Quality dimensions

  • Completeness: required fields present, expected rows arrived (no missing day of orders).
  • Uniqueness: no duplicate keys.
  • Validity: values in allowed ranges and formats (PIN codes are 6 digits, amounts are not negative, status is in a known list).
  • Consistency: the same fact agrees across tables (order totals equal the sum of items).
  • Accuracy: matches reality or the source system (reconciled totals).
  • Timeliness or freshness: data arrived when expected.

Where to check

  • At ingestion: schema, row counts, nulls in keys. Catch broken sources early.
  • After transformations: uniqueness of grain, referential integrity, business rules.
  • Before publishing: reconciliation against source totals and sanity bounds (today's revenue within a range of last week's).

Severity and actions

  • Error (blocking): stop the pipeline so bad data does not reach dashboards.
  • Warn: log and alert but continue.
  • Quarantine bad records in a separate table rather than silently dropping them.

Process

Every incident should end with a new test that would have caught it. Track data incidents like software bugs.

Pitfalls

  • Hundreds of noisy tests that everyone learns to ignore.
  • Only testing schema while business logic silently breaks (revenue doubled because a join fanned out).
  • Dropping bad rows without telling anyone.

You are ready to move on when you can take one of your pipelines and list, for each layer, the specific checks you would add, their severity and what happens when each fails.

Key concepts

  • Completeness and uniqueness
  • Validity and consistency
  • Accuracy and reconciliation
  • Freshness
  • Blocking vs warning checks
  • Quarantine tables
  • Data incident process

Mini project

Write a data quality plan for your dbt or Spark project: a table of checks per layer with dimension, rule, severity and owner. Implement five of them as SQL queries that return failing rows.

Check yourself

Revenue on the dashboard doubled overnight but every schema and null check passed. Which quality dimension failed and what test would catch it?

Free resources