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

已提問 2 年前檢視次數 1975 次
1 個回答
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
專家
已回答 2 年前
  • 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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南