DynamoDB PartiQL Unsupported clause: LIMIT in console

0

Hi there, according to the documentation LIMIT is an optional parameter for DynamoDB PartiQL . However when I attempt to use it in the console by entering a statement like select * from "USER" limit 1 I receive an error "ValidationException: Unsupported clause: LIMIT "

Would be good if the console supported this since the API does

asked 2 years ago1962 views
1 Answer
3

Hi, This is expected behaviour as the Limit parameter does not belong to the Statement but rather the request body:

{
   "ConsistentRead": boolean,
   "Limit": number,
   "NextToken": "string",
   "Parameters": [ 
     ...
   ],
   "ReturnConsumedCapacity": "string",
   "Statement": "string"
}
  client.executeStatement({
    Statement: statement, 
    Limit: 1
  })

For that reason, Limit is not currently available for the Web Console.

profile pictureAWS
EXPERT
answered 2 years ago
  • It makes sense in a way, although someone with a SQL background may find this counter-intuitive. For example ORDER BY is part of the statement for example and from a SQL point of view LIMIT and ORDER BY are both equally part of a "regular" SQL statement

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions