3

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.

jcollum
  • 43,623
  • 55
  • 191
  • 321

3 Answers3

6

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.

hunterhacker
  • 6,378
  • 1
  • 14
  • 11
  • "I don’t know what 1:8:5 indicates." -- line position and (apparently) the length of the token causing the problem – jcollum Jul 19 '23 at 15:37
3

The 5 in 1:8:5 is the length of the substring that is causing the error.

select count(divisionID) from "org-data-dev";
       ~~~~~
Alex Q
  • 3,080
  • 2
  • 27
  • 29
3

1:8:5 indicates 1 = line 8 = position of the character 5 = Number of character

Yahya
  • 45
  • 1