flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request #3589: [FLINK-5047] [table] Add count sliding group-windo...
Date Wed, 29 Mar 2017 21:47:17 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3589#discussion_r108791475
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/dataset/DataSetWindowAggregateITCase.scala
---
    @@ -354,4 +354,94 @@ class DataSetWindowAggregateITCase(
         val results = windowedTable.toDataSet[Row].collect()
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
    +
    +  @Test
    +  def testEventTimeSlidingGroupWindowOverCountOverlappingFullPane(): Unit = {
    +    // please keep this test in sync with the DataStream processing-time variant
    +    val env = ExecutionEnvironment.getExecutionEnvironment
    +    val tEnv = TableEnvironment.getTableEnvironment(env)
    +
    +    val table = env
    +      .fromCollection(data)
    +      .toTable(tEnv, 'long, 'int, 'double, 'float, 'bigdec, 'string)
    +
    +    val windowedTable = table
    +      .window(Slide over 4.rows every 2.rows on 'long as 'w)
    +      .groupBy('string, 'w)
    +      .select('string, 'int.count)
    +
    +    val expected =
    +      "Hello world,2\n" +
    +      "Hello,2"
    --- End diff --
    
    shouldn't this be "Hello,4"? There are four rows with `'string = "Hello"` in the data
set. Shouldn't those be aggregated in a sliding count window of size 4?


---
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