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

QuerydslMongoPredicateExecutor findAll() tries to get offset for a Pageable.unpaged() #3751

Closed
sfgvieira opened this issue Jul 26, 2021 · 3 comments
Assignees
Labels
status: feedback-provided Feedback has been provided type: bug A general bug

Comments

@sfgvieira
Copy link

Hi,
When passing a Pageable.unpaged() to findAll(Predicate predicate, Pageable pageable) in the QuerydslMongoPredicateExecutor, it will try to call the pageable.getOffset() which will to a java.lang.UnsupportedOperationException.

I suppose this is a bug because the documentation of the findAll mentions that the pageable can be unpaged.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 26, 2021
@mp911de
Copy link
Member

mp911de commented Jul 26, 2021

What would you expect as a result from such a call?

@mp911de mp911de added the status: waiting-for-feedback We need additional information before we can continue label Jul 26, 2021
@sfgvieira
Copy link
Author

sfgvieira commented Jul 26, 2021

My expectation is that if the provided pageable is unpaged, then it would not apply pagination to the result and instead it would provide me an unpaged page with the available contents.

The PageableExecutionUtils.getPage(...) call seems to already do this but it never gets to be executed because it fails at the applyPagination(query, pageable) due to the call to pageable.getOffset() which results in the java.lang.UnsupportedOperationException when the pageable is unpaged.

So as it is right now yes in can take a Pageable.unpaged() but it will always result in a java.lang.UnsupportedOperationException, therefore it doesn't seem useful to me (unless I am missing something :) )

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jul 26, 2021
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 26, 2021
@mp911de
Copy link
Member

mp911de commented Jul 26, 2021

Thanks a lot. By checking the other implementations, Pageable.unpaged() should indeed return all results. The JPA module does already the right thing and we need to fix the issue in MongoDB.

@mp911de mp911de self-assigned this Jul 26, 2021
christophstrobl pushed a commit that referenced this issue Jul 27, 2021
…cateExecutor.findAll(…).

We now correctly consider unpaged queries if the Pageable is unpaged.

Closes: #3751
Original Pull Request: #3754
christophstrobl pushed a commit that referenced this issue Jul 27, 2021
…cateExecutor.findAll(…).

We now correctly consider unpaged queries if the Pageable is unpaged.

Closes: #3751
Original Pull Request: #3754
@christophstrobl christophstrobl added this to the 3.1.12 (2020.0.12) milestone Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided type: bug A general bug
Projects
None yet
4 participants