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

    https://github.com/apache/flink/pull/3364#discussion_r104527336
  
    --- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/dataset/DataSetWindowAggregateITCase.scala
 ---
    @@ -169,4 +168,228 @@ class DataSetWindowAggregateITCase(configMode: 
TableConfigMode)
           .toDataSet[Row]
       }
     
    +  @Test(expected = classOf[UnsupportedOperationException])
    +  def testAllEventTimeSlidingGroupWindowOverCount(): Unit = {
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env, config)
    +
    +    val table = env.fromCollection(data).toTable(tEnv, 'long, 'int, 
'string)
    +
    +    // Count sliding non-grouping window on event-time are currently not 
supported
    +    table
    +      .window(Slide over 2.rows every 2.rows on 'long as 'w)
    +      .groupBy('w)
    +      .select('int.count)
    +      .toDataSet[Row]
    +  }
    +
    +  @Test
    +  def testAllEventTimeSlidingGroupWindowOverTime(): Unit = {
    +    // please keep this test in sync with the DataStream variant
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env)
    +
    +    val table = env.fromCollection(data).toTable(tEnv, 'long, 'int, 
'string)
    +
    +    val windowedTable = table
    +      .window(Slide over 5.milli every 2.milli on 'long as 'w)
    +      .groupBy('w)
    +      .select('int.count, 'w.start, 'w.end)
    +
    +    val expected =
    +      "1,1970-01-01 00:00:00.008,1970-01-01 00:00:00.013\n" +
    +      "1,1970-01-01 00:00:00.012,1970-01-01 00:00:00.017\n" +
    +      "1,1970-01-01 00:00:00.014,1970-01-01 00:00:00.019\n" +
    +      "1,1970-01-01 00:00:00.016,1970-01-01 00:00:00.021\n" +
    +      "2,1969-12-31 23:59:59.998,1970-01-01 00:00:00.003\n" +
    +      "2,1970-01-01 00:00:00.006,1970-01-01 00:00:00.011\n" +
    +      "3,1970-01-01 00:00:00.004,1970-01-01 00:00:00.009\n" +
    +      "4,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005\n" +
    +      "4,1970-01-01 00:00:00.002,1970-01-01 00:00:00.007"
    +
    +    val results = windowedTable.toDataSet[Row].collect()
    +    TestBaseUtils.compareResultAsText(results.asJava, expected)
    +  }
    +
    +  @Test
    +  def testEventTimeSlidingGroupWindowOverTimeOverlappingFullPane(): Unit = 
{
    +    // please keep this test in sync with the DataStream variant
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env)
    +
    +    val table = env.fromCollection(data).toTable(tEnv, 'long, 'int, 
'string)
    +
    +    val windowedTable = table
    +      .window(Slide over 10.milli every 5.milli on 'long as 'w)
    +      .groupBy('string, 'w)
    +      .select('string, 'int.count, 'w.start, 'w.end)
    +
    +    val expected =
    +      "Hallo,1,1969-12-31 23:59:59.995,1970-01-01 00:00:00.005\n" +
    +      "Hallo,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.01\n" +
    +      "Hello world,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.01\n" +
    +      "Hello world,1,1970-01-01 00:00:00.005,1970-01-01 00:00:00.015\n" +
    +      "Hello world,1,1970-01-01 00:00:00.01,1970-01-01 00:00:00.02\n" +
    +      "Hello world,1,1970-01-01 00:00:00.015,1970-01-01 00:00:00.025\n" +
    +      "Hello,1,1970-01-01 00:00:00.005,1970-01-01 00:00:00.015\n" +
    +      "Hello,2,1969-12-31 23:59:59.995,1970-01-01 00:00:00.005\n" +
    +      "Hello,3,1970-01-01 00:00:00.0,1970-01-01 00:00:00.01\n" +
    +      "Hi,1,1969-12-31 23:59:59.995,1970-01-01 00:00:00.005\n" +
    +      "Hi,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.01"
    +
    +    val results = windowedTable.toDataSet[Row].collect()
    +    TestBaseUtils.compareResultAsText(results.asJava, expected)
    +  }
    +
    +  @Test
    +  def testEventTimeSlidingGroupWindowOverTimeOverlappingSplitPane(): Unit 
= {
    +    // please keep this test in sync with the DataStream variant
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env)
    +
    +    val table = env.fromCollection(data).toTable(tEnv, 'long, 'int, 
'string)
    +
    +    val windowedTable = table
    +      .window(Slide over 5.milli every 4.milli on 'long as 'w)
    +      .groupBy('string, 'w)
    +      .select('string, 'int.count, 'w.start, 'w.end)
    +
    +    val expected =
    +      "Hallo,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005\n" +
    +      "Hello world,1,1970-01-01 00:00:00.004,1970-01-01 00:00:00.009\n" +
    +      "Hello world,1,1970-01-01 00:00:00.008,1970-01-01 00:00:00.013\n" +
    +      "Hello world,1,1970-01-01 00:00:00.012,1970-01-01 00:00:00.017\n" +
    +      "Hello world,1,1970-01-01 00:00:00.016,1970-01-01 00:00:00.021\n" +
    +      "Hello,2,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005\n" +
    +      "Hello,2,1970-01-01 00:00:00.004,1970-01-01 00:00:00.009\n" +
    +      "Hi,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005"
    +
    +    val results = windowedTable.toDataSet[Row].collect()
    +    TestBaseUtils.compareResultAsText(results.asJava, expected)
    +  }
    +
    +  @Test
    +  def testEventTimeSlidingGroupWindowOverTimeNonOverlappingFullPane(): 
Unit = {
    +    // please keep this test in sync with the DataStream variant
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env)
    +
    +    val table = env.fromCollection(data).toTable(tEnv, 'long, 'int, 
'string)
    +
    +    val windowedTable = table
    +      .window(Slide over 5.milli every 10.milli on 'long as 'w)
    +      .groupBy('string, 'w)
    +      .select('string, 'int.count, 'w.start, 'w.end)
    +
    +    val expected =
    +      "Hallo,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005\n" +
    --- End diff --
    
    There are two result rows for the same window (Hallo, 00:00:00.0, 
00:00:00.005). Is this correct?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to