Hi Nat,

Thanks for your message.

At the moment this is how window() works, but your use case sounds
reasonable. Would you mind reporting and issue for this on GitHub (
https://github.com/jOOQ/jOOL) so we can discuss and track this feature
request there?

Since you mention that you are pulling the data from a database I am
however also wondering why you don't use window functions directly in your
DB query. That would surely be a lot more efficient, no?

Knut

On Tue, Jul 30, 2019 at 11:28 PM <[email protected]> wrote:

> 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.)
>
> I've attached a simple program that exhibits the behavior.
>
>
> 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?
>
>
> Thanks.
>
>
> Nat
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/9114e574-7d05-4109-95f8-c9700b38fc32%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/9114e574-7d05-4109-95f8-c9700b38fc32%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAFx%3DKgeAHt8sBKaiRnP3QARVyFtgS8hVy4eHOO65v93h1svaMQ%40mail.gmail.com.

Reply via email to