How to increase expiration of NextToken in DynamoDB ExecuteStatement?
We have an API that reads the data from DynamoDB by using PartiQL query in ExecuteStatementWithContext function. This API is paginated and i rely on NextToken for reading all DynamoDB pages.
The problem is that there is an expiry for NextToken and i am getting this error
ValidationException: Given NextToken has already expired. Can we increase this expiry in any way?
NextToken has a validity of 1 hour, which the token then expires. There is no way to increase this using the PartiQL API. However, re-writing your code to suit DynamoDB Vanilla API will allow you to retrieve a
LastEvaluatedKey which does not expire and may be better suited for your use-case.
Thanks for the answer @Leeroy Hannigan.
We cannot use Vanilla API because we need to query multiple partition keys in the single query. This is possible currently using PartiQL only.
It would be of great benefit if
LastEvaluatedKeysupport is present for PartiQL. I can see there is already a question asked couple of months back(https://repost.aws/questions/QUgNPbBYWiRoOlMsJv-XzrWg/how-to-use-last-evaluated-key-in-execute-statement-request). Is there any ETA on this?
Using PartiQL as a workaround for a Batch Query is only saving you time on network latency, each
Queryon the back-end is executed sequentially. So if you use the vanilla API and multi-thread individual
Queryoperations, you will see very little difference in latency and have the advantage of using
On the ETA of
LEKbeing available for PartiQL, we never provide ETA's for any of our feature releases, but you can keep up to date with the newly released features here: https://aws.amazon.com/new/
NextToken from ExecuteStatement returns error "NextToken does not match request" in Lambda functionasked 2 months ago
AWS Dynamodb - PartiQLasked a month ago
How to increase expiration of NextToken in DynamoDB ExecuteStatement?asked 18 days ago
How to use LastEvaluatedKey in ExecuteStatement request?Accepted Answerasked 2 months ago
DynamoDB PartiQL Unsupported clause: LIMIT in consoleasked 4 months ago
Unable to query dynamodb table in Athena using DynamoDB ConnectorAccepted Answerasked 2 years ago
How to use Amplify Datastore to sync with data from DynamoDB and seed DynamoDB from a Lambaasked 5 months ago
Now DynamoDB can return the throughput capacity consumed by PartiQL API calls to help you optimize your queries and throughput costsasked 5 months ago
Using PartiQL with DAX client for dynamodbAccepted Answerasked 2 months ago
How to store the Athena Query Results in DynamoDB table?asked 3 years ago