- Newest
- Most votes
- Most comments
Based on the current DQDL specification, this appears to be a limitation in how composite rules interact with where clauses rather than a documented bug. Here's what's happening:
Current DQDL Support:
- Composite rules using
andandoroperators are supported for combining multiple rules whereclauses are supported for filtering data before applying data quality rules- However, the syntax for applying a
whereclause to an entire composite expression is not explicitly documented as supported
Why Your Workaround Works:
When you split the composite rule into two separate rules with individual where clauses, each rule is parsed independently with its own filter condition. This follows the documented pattern where where clauses are applied at the individual rule level.
The Parsing Issue:
The parser appears to expect where clauses to be associated with individual rule expressions rather than composite expressions. When you write:
(ColumnLength "field_a" >= 1) and (ColumnLength "field_a" <= 5) where "status_flag = DATE '2099-12-31'"
The parser may be interpreting the where clause as applying only to the last part of the composite expression, or it may not recognize this as valid syntax at all, resulting in the parsing error.
Recommendation:
Your workaround of using separate rules with repeated where clauses is currently the correct approach. While this requires duplicating the filter condition, it aligns with how DQDL currently handles the combination of composite rules and filtering.
This does appear to be a gap in the DQDL syntax that could benefit from either explicit documentation or enhancement to support where clauses on composite expressions directly.
Sources
Troubleshooting AWS Glue Data Quality errors - AWS Glue
Data Quality Definition Language (DQDL) reference - AWS Glue
AWS Glue Data Quality - AWS Glue
It's not a bug, it's a confirmed limitation on the DQDL grammar. You work around it like you did, or (at least in your particular example) use a different expression like between that would let you use a single where clause.
The documentation could be clearer, though. I recommend that you use the Feedback link on the DQDL reference page.
Thanks, that helps clarify that this is a grammar limitation rather than a parser bug.
One important point, though: using
betweenis not equivalent in my case. I tested that option earlier, but in the current DQDL reference,between x and yis documented as exclusive. Because of that, it does not preserve the same semantics as:ColumnLength "field_a" >= 1 and ColumnLength "field_a" <= 5
For validations where the upper bound must be included,
betweenchanges the rule behavior and can introduce maintenance risk later, because the DQDL becomes shorter but no longer expresses the original constraint correctly.
Relevant content
- asked 3 years ago
- asked 3 years ago
- AWS OFFICIALUpdated a year ago

The parser error could be improved to explicitly say composite expressions do not support
where. Also, the DQDL docs could include an example of the supported workaround.