LEAD/LAG functions

2021-01-29 Thread Patrick Angeles
Another (hopefully newbie) question. Trying to use LEAD/LAG over window functions. I get the following error. The exact same query works properly using FIRST_VALUE instead of LEAD. Thanks in advance... - Patrick Flink SQL> describe l1_min ; +---++--+-+--

Re: LEAD/LAG functions

2021-02-01 Thread Timo Walther
Hi Patrick, I could imagine that LEAD/LAG are translated into RANK/ROW_NUMBER operations that are not supported in this context. But I will loop in @Jark who might know more about the limitaitons here. Regards, Timo On 29.01.21 17:37, Patrick Angeles wrote: Another (hopefully newbie) questi

Re: LEAD/LAG functions

2021-02-01 Thread Jark Wu
Yes. RANK/ROW_NUMBER is not allowed with ROW/RANGE over window, i.e. the "ROWS BETWEEN 1 PRECEDING AND CURRENT ROW" clause. Best, Jark On Mon, 1 Feb 2021 at 22:06, Timo Walther wrote: > Hi Patrick, > > I could imagine that LEAD/LAG are translated into RANK/ROW_NUMBER > operations that are not s

Re: LEAD/LAG functions

2021-02-02 Thread Patrick Angeles
Thanks, Jark. On Mon, Feb 1, 2021 at 11:50 PM Jark Wu wrote: > Yes. RANK/ROW_NUMBER is not allowed with ROW/RANGE over window, > i.e. the "ROWS BETWEEN 1 PRECEDING AND CURRENT ROW" clause. > > Best, > Jark > > On Mon, 1 Feb 2021 at 22:06, Timo Walther wrote: > >> Hi Patrick, >> >> I could imagi