Glossary Entry

What is Data Profiling?

Data profiling is the process of examining a dataset's structure, content, and quality before use. Learn its three phases and how it guides pipeline design.

Written by Alex Merced

What is Data Profiling?

Introduction to Data Profiling

Before a data engineer can build an ETL pipeline, or a data scientist can train a machine learning model, they need to understand the raw material they are working with. If an engineer assumes a customer_age column only contains integers between 18 and 100, but the data actually contains the string "Unknown" in many rows, the downstream pipeline will fail when it tries to perform calculations.

Data Profiling is the diagnostic process of examining, analyzing, and summarizing a dataset to understand its structure, content, and quality before it is used in production systems. It is the data engineering equivalent of a doctor taking a patient’s vital signs before beginning surgery.

The Three Phases of Data Profiling

Data profiling is generally broken down into three types of analysis.

1. Structure Discovery

This is the most basic level of profiling. It examines the physical schema of the data to ensure it aligns with expectations.

  • Data Types: Is the phone_number column an Integer or a String? (Hint: It should be a string to preserve leading zeros).
  • Format Patterns: Do the dates follow YYYY-MM-DD or MM/DD/YYYY? Do the email addresses contain an @ symbol?
  • Length: What is the minimum and maximum character length of the address column? If the max length is 2, the data is likely corrupted.

2. Content Discovery

Content discovery digs into the actual values stored inside the rows, utilizing statistical analysis to map the shape of the data.

  • Null / Blank Ratios: What percentage of the middle_name column is missing?
  • Cardinality: How many unique values exist in the US_State column? If the cardinality is well above 50 (plus DC and the territories you expect), there is likely corrupted data.
  • Statistical Distributions: For numerical columns like salary, the profiler calculates the Mean, Median, Mode, Standard Deviation, and Min/Max bounds. It identifies extreme outliers (e.g., a salary of $999,999,999) that indicate a data entry error.

3. Relationship Discovery

This phase analyzes how different columns and tables relate to each other, which is critical for understanding legacy databases with undocumented schemas.

  • Primary/Foreign Keys: The profiler might notice that nearly all of the values in the Order.customer_id column exist in the Customer.id column, deducing a foreign key relationship.
  • Functional Dependencies: The profiler might deduce that if State = "Florida", then Country always equals "USA". If it finds a single row where State = "Florida" and Country = "Canada", it highlights the anomaly.

How Profiling Drives Data Architecture

Data profiling is not just an academic exercise; it informs architectural decisions in the Data Lakehouse.

  1. Storage Optimization (Z-Ordering and Partitioning): If a data engineer profiles a large table and discovers that queries are mostly filtered by event_date (low cardinality) and customer_id (high cardinality), they can partition the Iceberg table by event_date and apply Z-Ordering to the customer_id, improving query speeds.
  2. Building Data Contracts: Before deploying tools like Great Expectations, the data team runs an automated profiler. The profiler creates a baseline statistical model (e.g., “The mean transaction amount is $50”). The team uses this baseline to write automated Data Quality tests, so that future pipelines halt if the daily mean suddenly jumps to $5,000.

Conclusion

Data Profiling shifts data teams from reactive debugging to proactive engineering. By systematically mapping the statistical boundaries, formatting inconsistencies, and relational structures of raw datasets, profiling replaces the untested assumptions that cause data pipelines to fail. It provides the blueprint needed to build reliable transformations, enforce data quality rules, and deliver trustworthy analytics to the enterprise.

Learn More

To learn more about the Data Lakehouse, read The Lakehouse Built for Everyone by Alex Merced. You can find this and other books by Alex Merced at books.alexmerced.com.

Work with Alex