Data Quality Checks: Tutorial & Automation Best Practices
Learn the fundamentals of data quality checks, like structural and logical validation, monitoring data volume, and anomaly detection, using practical examples.
Table of Contents
- Summary of key concepts related to data quality checks
- Understanding data quality dimensions
- Structural checks: Schema and data types
- Integrity checks: Logical consistency
- Volumetric and freshness monitoring
- Advantages of automated rule inference over manual check authoring
- Orchestrating check execution and managing anomaly lifecycles
- Last thoughts
Summary of key concepts related to data quality checks
| Concept | Description |
| Understanding data quality dimensions | Data quality can be assessed across eight dimensions: accuracy, completeness, consistency, volumetrics, timeliness, conformity, precision, and coverage. |
| Structural checks: Schema and data types | Schema validation and data type enforcement catch breaking changes and format violations before they corrupt downstream systems. |
| Integrity checks: Logical consistency | Referential integrity, constraint validation, range checks, and cross-field logic ensure that data relationships and dependencies remain valid across tables and fields. |
| Volumetric and freshness monitoring | Record counts and freshness thresholds detect pipeline failures and stale data before consumers notice missing updates. |
| Advantages of automated rule inference over manual check authoring | Automated and hybrid approaches reduce manual effort while covering far more data. Profiling and machine learning detect patterns, anomalies, and hidden issues, while targeted manual rules handle the complex business-specific cases that automation can’t fully capture. |
| Orchestrating checks and managing anomalies | Catalog-profile-scan workflows combined with anomaly tracking ensure systematic coverage and accountability for resolution. |
Understanding data quality dimensions
Data quality can be thought of in eight dimensions, each measuring a different aspect of reliability. Looking at data through these lenses helps teams catch errors, inconsistencies, and gaps before they impact business decisions. Modern frameworks typically measure data across eight key dimensions to provide a complete view of data health.
Accuracy
Accuracy checks make sure data matches real-world values by comparing it to trusted sources. For example, a retail store might check customer ZIP codes against official postal data, or an online store might compare order totals with payment records. If something doesn't match, accuracy checks catch it quickly, preventing bad data from being included in reports.
Completeness
Completeness measures the percentage of non-null values in fields. Instead of just counting empty spots, good completeness checks look at how much data you expect and spot patterns in what is missing. Completeness also means checking for missing links between tables and missing time periods in the data. Here is an example of incomplete customer data:
| customer_id | name | state | phone | |
| 10234 | John Smith | john.smith@email.com | CA | 415-555-0123 |
| 10235 | sarah.j@email.com | TX | NULL | |
| 10236 | Mike Chen | NULL | 212-555-9876 |
Key fields like name, email, and state contain NULL values, which makes these customer records unusable for marketing campaigns and support operations.
Consistency
Consistency checks make sure the same data is represented uniformly across different tables, systems, or sources. For example, a customer should have matching identifiers and attributes across CRM, billing, and analytics systems. If values differ, reports can conflict and downstream joins may break, undermining a single source of truth.
Volumetrics
Volumetric checks analyze consistency in data size and structure over time. They detect deviations in record counts, unexpected drops in table rows, or unusual spikes that may indicate duplicate processing or incomplete extracts.
Timeliness
Timeliness checks track how quickly data is delivered and whether it’s fresh, in line with expected service-level agreements (SLAs). Even if the data is correct, stale data can hurt decision-making. Freshness checks show how old the records are. If upstream systems miss their delivery times, teams get alerts.
| table_name | last_update | minutes_stale | expected_sla |
| orders | 2025-11-25 09:45:00 | 105 | 15 minutes |
| inventory | 2025-11-25 11:25:00 | 5 | 10 minutes |
| customer_events | 2025-11-25 08:15:00 | 195 | 30 minutes |
The orders table is 105 minutes stale, exceeding the SLA by a factor of seven. Customer_events is 195 minutes behind, or 6.5 times the allowed lag.
Conformity
Conformity checks whether data adheres to required formats, patterns, and business rules. Issues can arise if, for example, a US phone number shows up as “4155550123” in one table and “(415) 555-0123.” Joins break and records become duplicated in aggregations when the same data types appear in different formats.
Precision
Precision checks whether field values meet the required level of detail. For numbers, this means checking that values are recorded with the appropriate level of granularity; for dates and times, it checks if the data is recorded in seconds or milliseconds. Precision checks make sure data is detailed enough for its purpose.
Coverage
Coverage measures whether fields have adequate quality checks defined to monitor their health. A field with high coverage has multiple checks validating different aspects of its quality, while low coverage indicates monitoring gaps that could allow issues to go undetected.
Structural checks: Schema and data types
Having established what to measure, the next question becomes how to enforce these quality standards. Structural checks are your first line of defense against data quality issues caused by schema or type mismatches. These checks confirm that the incoming data matches what you've defined for schemas and types.
Schema validation
Schema validation catches unauthorized column changes, such as additions, deletions, or modified types, that can cause problems downstream if they are not caught.
Data type enforcement
Without data type enforcement, fields can contain values that are incompatible with their intended use in calculations. Take a pricing column that gets filled with text values by mistake.
| order_id | unit_price | quantity | order_date |
| 1001 | 49.99 | 2 | 2025-12-15 |
| 1002 | TBD | 1 | 2025-12-15 |
| 1003 | contact sales | 5 | 2025-12-15 |
| 1004 | 129.50 | three | 2025-12-16 |
| 1005 | 89.00 | 1 | N/A |
Format validation
Format validation uses regular expressions to catch problems like malformed emails, phone numbers, and identifiers before they reach your customer-facing systems.
| customer_id | phone | ssn | |
| 2001 | john.smith@email.com | 415-555-0123 | 123-45-6789 |
| 2002 | sarah.email.com | 4155559876 | 987-65-4321 |
| 2003 | mike@domain | (415) 555-0145 | 11122333 |
| 2004 | contact@@company.com | 415.555.0198 | 555-55-555 |
Integrity checks: Logical consistency
Integrity checks ensure that data is consistent, both between tables and inside each record. These checks find data problems, broken business rules, and missing links that structure checks do not catch.
Range validation
Consider this table with range issues:
| product_id | quantity | price | discount |
| 2001 | 150 | $49.99 | 10% |
| 2002 | -25 | $89.00 | 15% |
| 2003 | 500 | $0.00 | 120% |
| 2004 | 75 | $-15.50 | 8% |
| 2005 | 999999 | $12.99 | 5% |
Pattern matching
Pattern matching checks ensure that text fields conform to expected structural formats, such as required prefixes, separators, casing, and length.
Volumetric and freshness monitoring
Volumetric checks analyze how data changes over time.
Record count checks
Record count checks compare current batch sizes to historical baselines to catch pipeline problems that often go unnoticed.
Freshness thresholds
Freshness thresholds send alerts when source systems don't deliver updates on time.
Advantages of automated rule inference over manual check authoring
Writing data quality checks by hand does not scale because large systems can require thousands of rules.
Statistical profiling
Statistical profiling looks at past data to find normal values and patterns automatically, reducing the need to manually design and maintain rules.
Machine learning approaches
Machine learning works differently from traditional methods. Instead of writing rules for every case, it learns what’s normal from the data itself.
Orchestrating check execution and managing anomaly lifecycles
Data quality checks only work if you run them regularly and fix the problems they find.
Catalog operations
Catalog operations scan data sources to find tables and setups.
Profile operations
Profile operations collect statistics on each column to understand data distributions and common values.
Scan operations
Scans are executed automatically by the system, applying the validation rules derived from profiling or manual definitions to each dataset.
Remediation workflows
Remediation workflows track problems from discovery through resolution.
Last thoughts
As systems grow, teams must balance how much they check, how quickly things run, and the effort required for data quality checks.