-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DynamoDbEnhancedClient: @QueryEnhancedRequest limit parameter is not limiting the search results as expected #1951
Comments
Hi @lakshmi-prameela-lanka-wcar the limit in the QueryEnhancedRequest defines the limit of items per page. The SDK v2 by default uses pagination methods that fetches all pages automatically. If you want to define a limit in the fetched results, you can specify it in the
Let us know if that helps. EDIT: there's other ways to limit the number of results, see comment here: #3226 (comment) |
It looks like this issue hasn’t been active in longer than a week. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it. |
Hi @debora-ito ,
I am using the enhanced request with LSI instead of table. My code looks something like this.
Did you mean this query automtically fetch all items in dynamoDB? Right now, I run into performance issue because some movies have like 10k items and requests takes like 10s. I actually want to limit like just 100 movies in order of the creationTime which is why I created the LSI. |
@debora-ito For code snippet you presented, where do I get the lastEvaluatedKey through PageIterable? |
…b6a258c21 Pull request: release <- staging/dabc7d80-a38e-4a21-931b-c74b6a258c21
Hey folks! |
Describe the bug
Using aws DynamoDB Java sdk V2, and I would like to limit the number of results that are returned when querying by the partition key (code snippet below), but the code below returns the full set of items.
Expected Behavior
QueryEnhnacedRequest operation should limit the number of items that it reads
Current Behavior
The limit parameter that we set on QueryEnhancedRequest is giving all the results as per the query condition, thought the limit parameter is set.
https://stackoverflow.com/questions/62417472/limit-method-in-queryenhancedrequest-for-dynamodb-java-v2-sdk-doesnt-limit-as-e
Steps to Reproduce
Context
Trying to fetch results from Dyanmodb using DynamoDbEnhancedClient with QueryEnhancedRequest
Your Environment
The text was updated successfully, but these errors were encountered: