Skip to content
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

Query Size Limits Not Working #89

Open
pluttrell opened this issue Aug 31, 2017 · 2 comments
Open

Query Size Limits Not Working #89

pluttrell opened this issue Aug 31, 2017 · 2 comments

Comments

@pluttrell
Copy link

Based on this answer, it sounds like limiting the results returned to a specific number should be working. However the following example does not appear to work as I'm getting back many more results.

List<Event> eventList = eventRepository.findByArenaId(arenaId, new PageRequest(0,2));

For this example Repository:

public interface EventRepository extends CrudRepository<Event, EventId> {
    List<Event> findByArenaId(String arenaId, Pageable pageable);
}

Is this a bug or is there something else that I need to do to get limits working?

@derjust derjust added the bug label Nov 3, 2017
@derjust derjust self-assigned this Nov 30, 2017
@derjust
Copy link
Owner

derjust commented Nov 30, 2017

I'm a bit unsure about what you try achieve here:
If the third element is read via the iterator or via List.get(int), the element is transparently loaded with a new request.

I guess you try to load at max 2 items - like a SQL TOP 2?

@derjust
Copy link
Owner

derjust commented Jan 17, 2018

To be a bit more specific: AWS SDK will always load the whole list (in a lazy fashion) if asked about all elements (.size() etc.).
Iterating over the list will fetch as many elements as requested via a provided Pageable as soon as #117 is merged :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants