amazon-web-servicesamazon-dynamodbpartiql

Can I use COUNT in a PartiQL query of a Dynamo table?


Trying all of these in PartiQL Editor. DynamoDB > PartiQL editor on the AWS site.

Query: select count(divisionID) from "org-data-dev";

Result: ValidationException: Unexpected path component at 1:8:5

Query: select count("divisionID") from "org-data-dev";

Result: ValidationException: Unexpected path component at 1:8:5

Query: select count(*) from "org-data-dev";

Result: ValidationException: Unexpected path component at 1:8:5

Query: select divisionID from "org-data-dev";

Result: (query succeeds)

Is it just not possible to use COUNT in PartiQL for Dynamo? The error is misleading in that case.

Also what is the 5 in 1:8:5 -- first line, 8th character and 5th... what? It's a 2D space, 3 coordinates makes no sense.


Solution

  • You cannot do COUNT with DynamoDB PartiQL. You can project out just the keys and count the delivered results.

    I don’t know what 1:8:5 indicates.