Checking Data Quality with AWS Glue Data Quality
This lesson explains how AWS Glue Data Quality evaluates declarative rules, inside ETL jobs or against Data Catalog tables, to check that data meets expectations before it is published, and reports the results for alerting and gating.
Learning outcomes
After completing this lesson, you will be able to:
- Write rules in DQDL.
- Choose where rules run: on catalogue tables or inside jobs.
- Use rule recommendations and dynamic rules.
- Act on results by quarantining rows or stopping a job.
Writing rules in DQDL
Glue Data Quality rules are written in the Data Quality Definition Language (DQDL), in short readable statements. IsComplete checks that a column has no missing values, and IsUnique checks that it has no duplicates, as an order ID should not. ColumnValues checks that values fall within a range, such as amounts above zero. RowCount checks the expected volume, which catches a load that silently produced too few rows. ReferentialIntegrity and DatasetMatch check consistency with another dataset, and DataFreshness checks that the newest records are recent enough. The following table summarises these rule types.
| Rule | Checks |
|---|---|
IsComplete "order_id" | No missing values |
IsUnique "order_id" | No duplicate values |
ColumnValues "amount" > 0 | Values within a range |
RowCount > 1000 | Expected volume |
ReferentialIntegrity, DatasetMatch | Consistency with another dataset |
DataFreshness | Timeliness of the latest records |
DQDL rules
Where rules run
Glue Data Quality can check data at two points. Rulesets attached to Data Catalog tables run on demand or on a schedule and check data already stored, which suits monitoring the quality of data at rest. Inside ETL jobs, the Evaluate Data Quality transform checks data as it flows through the pipeline and reports results for each row, so the job can stop, or send failing rows to a quarantine location, before bad data reaches consumers. The following table summarises the two options.
| Location | How | Use for |
|---|---|---|
| Data Catalog tables | Rulesets attached to a table, run on demand or on a schedule | Monitoring data at rest |
| Inside ETL jobs | The Evaluate Data Quality transform in Glue Studio or code | Gating data as it flows, with row-level results |
The following diagram shows the two points at which rules check data.

Where to run rules
Creating and adapting rules
Writing data quality rules from scratch is slow, and fixed thresholds go out of date as data grows. AWS Glue Data Quality helps with both problems. Rule recommendations analyse a dataset and suggest a starting ruleset, such as completeness and uniqueness checks for each column, which engineers then review and adjust.
Dynamic rules compare each run with recent history instead of a fixed number, for example RowCount > avg(last(10)) * 0.8, which fails if today's row count is more than 20% below the average of the last ten runs. Anomaly detection goes further: it learns the normal statistics of the data over time and flags unusual values without any threshold being set, which catches problems that nobody thought to write a rule for.
The following diagram shows a dynamic row count rule evaluating today's load.

Adapting rules
Acting on results
Each evaluation produces a score and per-rule results, published to CloudWatch and EventBridge. Jobs can route failing rows to a quarantine prefix, stop when the score falls below a threshold, and notify data owners through EventBridge and SNS.
The following diagram shows the ruleset in the job and where the data goes after evaluation.

Acting on quality results
Stopping bad data before it reaches reports
A daily customer feed sometimes arrives with missing emails and negative ages, which break the dashboards. The team adds the following Glue Data Quality rules in the ETL job.
Rules = [
IsComplete "customer_id",
IsUnique "customer_id",
Completeness "email" > 0.95,
ColumnValues "age" between 0 and 120,
RowCount between 50000 and 200000
]Rows that pass go to the curated zone; if the ruleset fails, the job writes the data to a quarantine prefix, publishes the result to EventBridge and alerts the data owners. Over time, rule recommendations and anomaly detection suggest further checks, such as a dynamic row count rule.
In which language are Glue Data Quality rules written?
Show answer
Data Quality Definition Language (DQDL).
Exam Tips
Remember for the exam
- Data quality rules in pipelines are written in DQDL for Glue Data Quality.
- To suggest rules from the data, use Glue Data Quality rule recommendations.
- To gate data inside a job, use the Evaluate Data Quality transform.
- Dynamic rules and anomaly detection catch unexpected changes without fixed thresholds.
- Quarantine bad rows and alert their owners through EventBridge.