Skip to content

DynamoDbEnhancedClient limit paginated result #3650

Answered by debora-ito
tomoaki3284 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tomoaki3284,

To be clear, even if no limit parameter is provided, a single query operation will read up to a maximum of 1 MB of data, according to the Query API Reference.

By simply setting limit on PageIterable, it will prevent fetching 1k items?

Yes. I'll use my code example in the issue you referenced to try to clarify:

    QueryEnhancedRequest request = QueryEnhancedRequest.builder()
                .queryConditional(QueryConditional.keyEqualTo(k -> k.partitionValue("001")))
                .limit(10)  // 10 items per response
                .scanIndexForward(true)
                .build();

    PageIterable<Customer> result = customerTable.query(request);

    result.stream()
…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tomoaki3284
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants