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

gefragt vor 2 Jahren1976 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 2 Jahren
  • 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

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen