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

    https://github.com/apache/flink/pull/3574#discussion_r106997447
  
    --- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/sql/WindowAggregateTest.scala
 ---
    @@ -239,4 +239,61 @@ 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 $3 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 " +
    +      "CURRENT ROW) as cnt1 " +
    +      "from MyTable"
    +
    +    val expected =
    +      unaryNode(
    +        "DataStreamCalc",
    +        unaryNode(
    +          "DataStreamOverAggregate",
    +          unaryNode(
    +            "DataStreamCalc",
    +            streamTableNode(0),
    +            term("select", "a", "c", "PROCTIME() AS $2")
    +          ),
    +          term("partitionBy", "c"),
    +          term("orderBy", "PROCTIME"),
    +          term("rows", "BETWEEN $3 PRECEDING AND CURRENT ROW"),
    --- End diff --
    
    Can we add the actual range value here instead of `$3`?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to