Search code examples
amazon-dynamodbpartiql

DynamoDB PartiQL error: "ValidationException: Overlapping conditions with range keys are not supported in where clause"


I'm getting the following error when I try to run a query in DynamoDB's PartiQL:

An error occurred during the execution of the command.
ValidationException: Overlapping conditions with range keys are not supported in where clause

The query looks like:

SELECT * FROM "tableName"
WHERE "columnName" IN (
'abc',
'def',
'def'
)

Solution

  • The error message is unnecessarily confusing, but it means that you have a duplicate value in your IN clause. If you remove the duplicate, the query will work. If you had a long list in the IN clause, it might have been hard to spot that you had a duplicate.