[ 
https://issues.apache.org/jira/browse/FLINK-5386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15812931#comment-15812931
 ] 

ASF GitHub Bot commented on FLINK-5386:
---------------------------------------

Github user shaoxuan-wang commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3046#discussion_r95244683
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/windows.scala
 ---
    @@ -150,7 +147,7 @@ class TumblingWindow(size: Expression) extends 
GroupWindow {
       def as(alias: String): TumblingWindow = 
as(ExpressionParser.parseExpression(alias))
     
       override private[flink] def toLogicalWindow: LogicalWindow =
    -    ProcessingTimeTumblingGroupWindow(alias, size)
    +    ProcessingTimeTumblingGroupWindow(name, size)
    --- End diff --
    
    Better to keep using "alias" here. By the way,
    I found that the input of some functions use "name", like 
ProcessingTimeTumblingGroupWindow, while some others use "alias", like 
TumblingEventTimeWindow. Better to change them consistently to "alias". What do 
you think.


> 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
>
> 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: 
> val windowedTable = table
>  .window(Slide over 10.milli every 5.milli as 'w1)
>  .window(Tumble over 5.milli  as 'w2)
>  .groupBy('w1, 'key)
>  .select('string, 'int.count as 'count, 'w1.start)
>  .groupBy( 'w2, 'key)
>  .select('string, 'count.sum as sum2)
>  .window(Tumble over 5.milli  as 'w3)
>  .groupBy( 'w3) // windowAll
>  .select('sum2, 'w3.start, 'w3.end)
> In this way, we can remove both GroupWindowedTable and the window() method in 
> GroupedTable which makes the API a bit clean. In addition, 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:
>   .window(RowXXXWindow as ‘x, RowYYYWindow as ‘y)
>   .select(‘a, ‘b.count over ‘x as ‘xcnt, ‘c.count over ‘y as ‘ycnt, ‘x.start, 
> ‘x.end)
> What do you think? [~fhueske] [~twalthr]



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

Reply via email to