flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sunjincheng121 <...@git.apache.org>
Subject [GitHub] flink pull request #3574: [FLINK-5653] Add processing time OVER ROWS BETWEEN...
Date Wed, 29 Mar 2017 06:38:19 GMT
Github user sunjincheng121 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3574#discussion_r108600245
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/sql/WindowAggregateTest.scala
---
    @@ -350,4 +350,59 @@ class WindowAggregateTest extends TableTestBase {
         streamUtil.verifySql(sql, expected)
       }
     
    +  @Test
    +  def testBoundedNonPartitionedProcessingWindowWithRow() = {
    +    val sql = "SELECT " +
    +      "c, " +
    +      "count(a) OVER (ORDER BY procTime() ROWS BETWEEN 2 preceding AND " +
    +      "CURRENT ROW) as cnt1 " +
    +      "from MyTable"
    +
    +    val expected =
    +      unaryNode(
    +        "DataStreamCalc",
    +        unaryNode(
    +          "DataStreamOverAggregate",
    +          unaryNode(
    +            "DataStreamCalc",
    +            streamTableNode(0),
    +            term("select", "a", "c", "PROCTIME() AS $2")
    +          ),
    +          term("orderBy", "PROCTIME"),
    +          term("rows", "BETWEEN 2 PRECEDING AND CURRENT ROW"),
    +          term("select", "a", "c", "PROCTIME", "COUNT(a) AS w0$o0")
    +        ),
    +        term("select", "c", "w0$o0 AS $1")
    +      )
    +    streamUtil.verifySql(sql, expected)
    +  }
    +  
    +  @Test
    +  def testBoundedPartitionedProcessingWindowWithRow() = {
    +    val sql = "SELECT " +
    +      "c, " +
    +      "count(a) OVER (PARTITION BY c ORDER BY procTime() ROWS BETWEEN 2 preceding AND
" +
    --- End diff --
    
    Change the number of `preceding` to greater than 3, for example:  `4 preceding`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message