flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6584) Support multiple consecutive windows in SQL
Date Thu, 29 Jun 2017 07:55:00 GMT

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

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

Github user wuchong commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4199#discussion_r124733642
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/common/WindowStartEndPropertiesRule.scala
---
    @@ -54,34 +56,75 @@ class WindowStartEndPropertiesRule
         val project = call.rel(0).asInstanceOf[LogicalProject]
         val innerProject = call.rel(1).asInstanceOf[LogicalProject]
         val agg = call.rel(2).asInstanceOf[LogicalWindowAggregate]
    +    val window = agg.getWindow
     
    -    // Retrieve window start and end properties
    +    val isRowtime = isRowtimeAttribute(window.timeAttribute)
    +    val isProctime = isProctimeAttribute(window.timeAttribute)
    +
    +    val startEndProperties = Seq(
    +      NamedWindowProperty("w$start", WindowStart(window.aliasAttribute)),
    +      NamedWindowProperty("w$end", WindowEnd(window.aliasAttribute)))
    +
    +    // allow rowtime/proctime for rowtime windows and proctime for proctime windows
    +    val timeProperties = if (isRowtime) {
    +      Seq(
    +        NamedWindowProperty("w$rowtime", RowtimeAttribute(window.aliasAttribute)),
    --- End diff --
    
    We have so many `w$...` here, can we create the String constants and reference them ?



> Support multiple consecutive windows in SQL
> -------------------------------------------
>
>                 Key: FLINK-6584
>                 URL: https://issues.apache.org/jira/browse/FLINK-6584
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>
> Right now, the Table API supports multiple consecutive windows as follows:
> {code}
> val table = stream.toTable(tEnv, 'rowtime.rowtime, 'int, 'double, 'float, 'bigdec, 'string)
> val t = table
>   .window(Tumble over 2.millis on 'rowtime as 'w)
>   .groupBy('w)
>   .select('w.rowtime as 'rowtime, 'int.count as 'int)
>   .window(Tumble over 4.millis on 'rowtime as 'w2)
>   .groupBy('w2)
>   .select('w2.rowtime, 'w2.end, 'int.count)
> {code}
> Similar behavior should be supported by the SQL API as well. We need to introduce a new
auxiliary group function, but this should happen in sync with Apache Calcite.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message