Conditional Functional Dependencies for Data Cleaning

Philip Bohannon, Wenfei Fan, Floris Geerts, Xibei Jia, Anastasios Kementsietsidis

Introduction

Data cleaning remains a significant challenge in database management, often costing organizations billions. While traditional Functional Dependencies (FDs) are essential for schema design, they are frequently too rigid for data cleaning tasks because they require rules to hold globally across an entire dataset. This paper introduces Conditional Functional Dependencies (CFDs), a framework that allows constraints to be applied to specific subsets of data, capturing the context-dependent nature of real-world information.

The Problem: Global vs. Conditional Constraints

Standard FDs, such as "Zip Code determines City," must hold for every record in a table. However, in global datasets, these rules often vary by region. For instance, a Zip Code might determine a City in the US, but follow a completely different logic in the UK. Traditional FDs cannot express these "bindings" of specific values, leading to missed errors or false positives during cleaning.

Example dataset illustrating inconsistent records across different regions and countries.

As shown in the example data above, records from different countries (CC) exhibit different patterns for area codes (AC) and cities (CT). CFDs address this by allowing rules to trigger only when specific conditions are met.

Methodology: Pattern Tableaus and SQL Detection

The authors propose a formal system for CFDs consisting of three main technical contributions:

  1. Formal Syntax and Semantics: A CFD is defined as a standard FD paired with a pattern tableau. This tableau uses constants to specify conditions and wildcards (unnamed variables) to define the scope of the dependency.
A pattern tableau defining conditional constraints for specific attribute values.
  1. Reasoning and Inference: The paper extends Armstrong’s Axioms to CFDs, allowing for the determination of consistency and the calculation of a "minimal cover"—the smallest set of rules necessary to represent the data logic. Unlike traditional FDs, sets of CFDs can be contradictory, making consistency checking a vital step.
  2. SQL-Based Detection: To facilitate practical use, CFDs are translated into SQL queries. The authors distinguish between single-tuple violations (contradicting a constant in the rule) and multi-tuple violations (two records contradicting each other within the rule's scope). A key optimization involves converting these queries into Disjunctive Normal Form (DNF), which significantly improves performance by allowing database engines to utilize indexes more effectively.

Experimental Evaluation

The framework was evaluated using synthetic tax records based on real-world US zip codes and tax data, scaling from 10,000 to 500,000 tuples. Key findings include:

  • Scalability: Detection time scales linearly with dataset size, proving the method's viability for large-scale data warehouses.
  • Query Optimization: The DNF strategy outperformed the standard CNF approach by an order of magnitude across all tests.
  • Rule Complexity: Rules with more variables (wildcards) are more computationally expensive to check because they limit the use of simple indexes during table joins.

Conclusion and Future Work

CFDs provide a powerful tool for identifying "dirty data" that escapes traditional schema constraints. While this work focuses on detection, the authors note that repairing data based on these rules is NP-complete. Future research directions include automated CFD discovery from existing data and the extension of this logic to other constraints like Inclusion Dependencies.

Summary updated

BibTeX
@inproceedings{bohannon2007conditional,
  author = {Philip Bohannon and Wenfei Fan and Floris Geerts and Xibei Jia and Anastasios Kementsietsidis},
  title = {{Conditional Functional Dependencies for Data Cleaning}},
  booktitle = {ICDE},
  year = {2007},
  doi = {10.1109/icde.2007.367920},
}
Figure