You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Expected behavior and actual behavior:
I'm building a
Seq
that containslimit()
andwindow()
terms and I'm seeing some surprising behavior:limit()
comes after the window() it appears that the iterator that theSeq
is based on gets completely drained even though the stream terminates as expected after the number of items specified in thelimit()
are processed.limit()
comes before thewindow()
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 thelimit()
comes after thewindow()
. 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:
The text was updated successfully, but these errors were encountered: