Redshift data API: programatically set MaxResults for getStatementResult

Viewed 640

I'm using the newly released Redshift Data API.

I'd like to programmatically paginate the query results which are returned from the getStatementResult action.

According to the API reference, getStatementResult returns a NextToken property, which implies it supports pagination.

However, I couldn't find a Limit or MaxResults argument: https://docs.aws.amazon.com/redshift-data/latest/APIReference/API_GetStatementResult.html

To make things more confusing, the CLI operation does support pagination using the --starting-token and --max-items arguments: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/redshift-data/get-statement-result.html

So, my questions are:

  1. Is it possible to paginate getStatementResult results programmatically?
  2. If not, then what's the meaning of the NextToken which is returned from getStatementResult? What is the default page size?

Thanks!

1 Answers
Related