AMC rejects the query: literal filter on a high-threshold column

AMC rejects queries that compare columns with the high or very high threshold to literal values, for example WHERE postal_code IN (10001, 10011).

Symptom

The query is rejected as soon as a literal (or a value derived from a literal or parameter) is compared to a column with the high or very high threshold. Amazon does not print a fixed message text for this.

Cause

Comparing against fixed values could single out individual users or very small groups. The rule covers every construct that compares multiple values: expressions such as Equals, RegexMatches or Min, join keys and group-by keys. Amazon's examples: postal_code (high) and user_id (very high).

Fix

  1. Remove the literal filter on the sensitive column.
  2. Group by the column and pick the values you want in the result file afterwards.
  3. Look up the threshold of each column in the schema reference first.

The cause follows the Amazon documentation. Some of the fix steps are our own judgement and do not replace asking Amazon support.

Source: AMC data aggregation thresholds (retrieved 2026-10-09)

See also: Schema reference with aggregation thresholds · All AMC errors