Re: [ DISCUSS] The window table functions join syntax

2020-09-24 Thread Rui Wang
Thanks Villiam for pointing this out! So the standard still solves duplicate names in "TUMBLE(TUMBLE())" by alias, which makes sense. Then we can evaluate whether Calcite supports alias for table function in a correct way in CALCITE-4274 . -Rui

Re: [ DISCUSS] The window table functions join syntax

2020-09-24 Thread Viliam Durina
I think we're discussing two issues. One is "TUMBLE join TUMBLE" and the other is "TUMBLE(TUMBLE())". In both cases the `window_start` and `window_end` columns are duplicated. In case of JOIN, I don't see any issue. It's equivalent to any join of two tables, e.g.: SELECT * FROM t1 JOIN t2

Re: [ DISCUSS] The window table functions join syntax

2020-09-23 Thread Kenneth Knowles
It happens in "raw Beam" somewhat often that there is one windowed aggregation followed by another. It is pretty unheard of to "assign" windows twice before an aggregation, because Beam cannot do anything useful with this: Beam does not have the ability to have two different fields/columns that

Re: [ DISCUSS] The window table functions join syntax

2020-09-23 Thread Julian Hyde
I don't think it's a problem with table functions in general. And besides, we can't change the semantics of table functions. A table function must not produce duplicate column names. The problem is with the semantics of these particular table functions - HOP, TUMBLE, SESSION - and what semantics

Re: [ DISCUSS] The window table functions join syntax

2020-09-23 Thread Rui Wang
>Is it reasonable to apply TUMBLE to TUMBLE? If so, would people > generally want two sets of window_start, window_end columns? I think it is reasonable to apply TUMBLE to TUMBLE or even TUMBLE to HOP join, as long as there is a real requirement there. The window starts/ends are not duplicates.

Re: [ DISCUSS] The window table functions join syntax

2020-09-23 Thread Julian Hyde
I think we should also discuss https://issues.apache.org/jira/browse/CALCITE-4274 here. We've never discussed what should happen if you apply TUMBLE to TUMBLE (or TUMBLE to HOP, etc.). What happens now is that you get duplicate columns. Is it reasonable to apply TUMBLE to TUMBLE? If so, would

Re: [ DISCUSS] The window table functions join syntax

2020-09-23 Thread Danny Chan
Thanks for the feedback, I agree we should keep the verbose part **L.window_start = R.window_start AND L.window_end =R.window_end** Which would make the semantic more clear ~ Best, Danny Chan 在 2020年9月23日 +0800 PM3:24,Viliam Durina ,写道: > You can also use > > SELECT L.f0, R.f2, L.window_start,

Re: [ DISCUSS] The window table functions join syntax

2020-09-23 Thread Rui Wang
Regarding to **L.window_start = R.window_start AND L.window_end = R.window_end**: In general, the current table function windowing model is to append window metadata to table directly, thus window metadata becomes a part of table (or call it data). So as a part of table, these two columns should

Re: [ DISCUSS] The window table functions join syntax

2020-09-22 Thread Danny Chan
Yes, the red part is **L.window_start = R.window_start AND L.window_end = R.window_end** > Is this a limitation for "triggered by the watermark of the stream”? No, because in most of the cases, there is no need to output the intermediate/partial join records then send retractions. So, how do

Re: [ DISCUSS] The window table functions join syntax

2020-09-22 Thread Rui Wang
Hi Danny, seems like the "Red" syntax is missing? I am guessing you were talking about "L.window_start = R.window_start AND L.window_end = R.window_end"? Can you use ** to indicate the red part. Two additional questions: > The Join action is triggered by the watermark of the stream So sounds

Re: [ DISCUSS] The window table functions join syntax

2020-09-22 Thread James Starr
Sorry, but what part is red. Your markup appears to have been stripped. James On Tue, Sep 22, 2020 at 9:05 PM Danny Chan wrote: > Hi, fellows, long time no see on the mailing ~ > > Here I want to have a discussion on the join syntax of our recently > introduced window table function ~ > > For

[ DISCUSS] The window table functions join syntax

2020-09-22 Thread Danny Chan
Hi, fellows, long time no see on the mailing ~ Here I want to have a discussion on the join syntax of our recently introduced window table function ~ For example, we can define a tumbling window function of 5 minutes size as: Tumble(table T, descriptor(T.ts), INTERVAL ‘5’ MINUTE) The we can