Automating Data Quality Validation for Dynamic Data Ingestion

Sergey Redyuk, Zoi Kaoudi, Volker Markl, Sebastian Schelter

Abstract

Validating data quality in dynamic pipelines typically relies on manual, brittle rules that struggle to keep pace with evolving data. This paper presents an automated approach that reframes data quality validation as a novelty detection problem. By utilizing descriptive statistics and machine learning, the system flags erroneous data batches without human intervention. Our results demonstrate that this method matches the performance of hand-tuned expert systems while achieving a processing speed over ten times faster than existing solutions.

Introduction

In modern data engineering, data lakes ingest vast quantities of information from heterogeneous sources such as web crawls and logs, which often lack strict schemas. When a source fails—due to sensor malfunctions or schema changes—it can corrupt entire data batches. Currently, engineers address this either reactively, by debugging after downstream failures, or proactively, by manually writing unit tests using tools like Deequ or TensorFlow Data Validation (TFDV). However, manual rules are expensive to maintain and quickly become stale as data naturally drifts. We propose a system that automatically learns the characteristics of "good" data and alerts users when anomalies occur.

Methodology

The proposed pipeline treats data validation as a one-class classification problem, following a four-step process:

  1. Feature Extraction: For every ingested batch, the system calculates a feature vector of descriptive statistics. This includes standard metrics (mean, max, min, null ratios), sketching algorithms (HyperLogLog for distinct counts), and textual analysis (Index of Peculiarity using trigram frequencies) to detect encoding errors.
  2. Novelty Detection: Previously ingested "safe" batches serve as the training set. The system employs a k-Nearest Neighbors (kNN) model with mean distance aggregation to define the boundaries of normal data.
  3. Validation: As new batches arrive, their statistics are computed and compared against the learned feature space.
  4. Self-Adaptation: The model accepts new valid batches into its training set, allowing it to adapt to legitimate data drift over time.
Overview of the automated data quality validation pipeline, illustrating feature extraction and novelty detection over time.

Experimental Results

The approach was evaluated on five real-world datasets, including flight status data (Flights) and Facebook posts (FBPosts), alongside large-scale testing with synthetically injected errors.

Performance and Accuracy

The kNN-based approach achieved a high ROC AUC of approximately 0.95, effectively matching the performance of "hand-tuned" baselines that require hours of expert configuration. Notably, it significantly outperformed the automated modes of TFDV and Deequ, which tended to produce excessive false alarms by being overly conservative.

Baseline comparison of ROC AUC scores across different datasets and partition windows, showing the proposed kNN method matching hand-tuned experts.

Computational Efficiency

Because the required statistics can be computed in a single pass, the system avoids the heavy overhead of traditional rule-based engines. In testing on the Amazon dataset, the proposed method validated a batch in roughly 0.2 seconds, compared to 7 seconds for Deequ and 14 seconds for TFDV—a speedup of at least one order of magnitude.

Conclusion and Future Work

This study demonstrates that high-level statistical aggregates serve as powerful proxies for data health. By focusing on novelty detection, the system can identify "unspecified" errors that engineers might not have anticipated. While the model currently faces a "cold start" challenge—requiring approximately eight clean initial batches to establish a baseline—it offers a scalable, low-maintenance alternative to manual validation. Future research will focus on detecting deterministic errors that preserve statistical distributions and developing standardized benchmarking datasets for the research community.

Summary updated

BibTeX
@inproceedings{redyuk2021automating,
  author = {Sergey Redyuk and Zoi Kaoudi and Volker Markl and Sebastian Schelter},
  title = {{Automating Data Quality Validation for Dynamic Data Ingestion}},
  booktitle = {EDBT},
  year = {2021},
  doi = {10.5441/002/edbt.2021.07},
}
Figure