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

Bad interaction between window() and limit() #357

Open
nmishkin opened this issue Jul 31, 2019 · 1 comment
Open

Bad interaction between window() and limit() #357

nmishkin opened this issue Jul 31, 2019 · 1 comment

Comments

@nmishkin
Copy link

Expected behavior and actual behavior:

I'm building a Seq that contains limit() and window() terms and I'm seeing some surprising behavior:

  • If the limit() comes after the window() it appears that the iterator that the Seq is based on gets completely drained even though the stream terminates as expected after the number of items specified in the limit() are processed.
  • If the limit() comes before the window() the iterator is not drained. (The stream also terminates as expected.)

In my real scenario, the iterator that the Seq is based on is an iterator on top of a DB cursor and the limit() comes after the window(). I really need the behavior to not be that the code tries to drain this iterator--i.e., read a ton of rows from the DB.

Is this a bug or just the way things work?

Steps to reproduce the problem:

I've attached a simple program that exhibits the behavior.

Versions:

  • jOOλ: 0.9.12
  • Java: 1.8
@knutwannheden
Copy link

See user group thread here: https://groups.google.com/forum/#!topic/jooq-user/gSi7CVhCEe4

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

No branches or pull requests

3 participants