DynamoDB how to use index in PartiQL queries?

Viewed 5177

I have seen the dynamoDB doc for the PartiQL syntax:

SELECT expression  [, ...] 
FROM table[.index]
[ WHERE condition ] [ [ORDER BY key  [DESC|ASC] , ...]

but in practice:

select * from dev .pk-all-index
where "pk" = 'config' AND ("brand" = 'tesla' OR contains("aliases", 'tesla.com'))

gives me the error:

An error occurred during the execution of the command. ValidationException: Statement wasn't well formed, can't be processed: Unexpected keyword

2 Answers

You might want to put the table name and index under quotes, individually.

SELECT * FROM "dev"."pk-all-index" WHERE "pk" = 'config' AND ("brand" = 'tesla' OR contains("aliases", 'tesla.com'))
Related