Skip to content

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

Closed

Description

@sfgvieira

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.

Activity

  1. mp911de commented on Jul 26, 2021

    @mp911de
    Member

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

  2. added
    status: waiting-for-feedback
    on Jul 26, 2021
  3. sfgvieira commented on Jul 26, 2021

    @sfgvieira
    Author

    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 :) )

  4. added
    status: feedback-provided
    and removed
    status: waiting-for-feedback
    on Jul 26, 2021
  5. added
    type: bug
    and removed
    status: waiting-for-triage
    on Jul 26, 2021
  6. mp911de commented on Jul 26, 2021

    @mp911de
    Member

    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.

  7. self-assigned this
    on Jul 26, 2021
  8. added 2 commits that reference this issue on Jul 27, 2021
    32223fc
    a1b4e3f
  9. added a commit that references this issue on May 20, 2024
    68370c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: feedback-providedtype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions