You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2017/01/20 15:43:26 UTC

[jira] [Closed] (FLINK-5386) Refactoring Window Clause

     [ https://issues.apache.org/jira/browse/FLINK-5386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fabian Hueske closed FLINK-5386.
--------------------------------
       Resolution: Implemented
    Fix Version/s: 1.3.0
                   1.2.0

Done for 1.2.0 with be09143cd323d478811447b10807ae7f7d6a4b7b
Done for 1.3.0 with 6bf556e60148917794f81088fa20c5cc7465823a

> Refactoring Window Clause
> -------------------------
>
>                 Key: FLINK-5386
>                 URL: https://issues.apache.org/jira/browse/FLINK-5386
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: sunjincheng
>            Assignee: sunjincheng
>             Fix For: 1.2.0, 1.3.0
>
>
> Similar to the SQL, window clause is defined "as" a symbol which is explicitly used in groupby/over. We are proposing to refactor the way to write groupby+window tableAPI as follows: 
> {code}
> tab //Table('a,'b,'c)
> .window( Slide over 10.milli every 5.milli  as 'w1as 'w1) // WindowedTable
> .groupBy('w1,'a,'b) // WindowGroupedTable
> .select('a,'b,c.count as 'mycount) // Table
> .window(Tumble over 5.milli  on 'b as 'w2)
> .groupBy('w2)
> .select('a.count, 'w2.start, 'w2.end)
> {code}
> In this way, for row-window, we anyway need to define window clause as a symbol. This change will make the API of window and row-window consistent, example for row-window:
> {code}
>   .window(RowXXXWindow as ‘x, RowYYYWindow as ‘y) // WindowedTable
>   .select(‘a, ‘b.count over ‘x as ‘xcnt, ‘c.count over ‘y as ‘ycnt, ‘x.start, ‘x.end)
> {code}
> What do you think? [~fhueske] [~twalthr]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)