"Logs" table in DynamoDB has a simple partition key:
It also has a global secondary index:
My query statement is:
SELECT *
FROM "Logs"."CustomerIdentifier-Timestamp-index"
WHERE "CustomerIdentifier" = 'ABC123'
AND "Timestamp" >= 638014484314658930
AND "Timestamp" <= 638014484914658930
ORDER BY "Timestamp"
And the error message returned from Dynamo is "Must have at least one non-optional hash key condition in WHERE clause when using ORDER BY clause."
I would have thought that WHERE "CustomerIdentifier" = 'ABC123'
meets this requirement. I am assuming that Timestamp
being a range is problem, but I really don't understand why. Can someone explain a) what have I done wrong here? b) conceptually, is this type of query possible in Dynamo? and c) if so, how would I accomplish it?