Github user twalthr commented on the issue:
https://github.com/apache/flink/pull/2938
Here is an example to reproduce the wrong results:
```scala
@Test
def testEventTimeTumblingWindowStream(): Unit = {
val env = StreamExecutionEnvironment.getExecutionEnvironment
env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
val tEnv = TableEnvironment.getTableEnvironment(env)
val stream = env
.fromCollection(data)
.assignTimestampsAndWatermarks(new TimestampWithEqualWatermark())
val table = stream.toTable(tEnv, 'long, 'int, 'string)
val windowedTable = table
.groupBy('string)
.window(Tumble over 5.milli on 'rowtime as 'w)
.select('string, 'int.count, 'int.avg, 'w.start, 'w.end)
val results = windowedTable.toDataStream[Row].print()
env.execute()
}
@Test
def testEventTimeTumblingWindowBatch(): Unit = {
val env = ExecutionEnvironment.getExecutionEnvironment
val tEnv = TableEnvironment.getTableEnvironment(env)
val stream = env
.fromCollection(data)
val table = stream.toTable(tEnv, 'long, 'int, 'string)
val windowedTable = table
.groupBy('string)
.window(Tumble over 5.milli on 'long as 'w)
.select('string, 'int.count, 'int.avg, 'w.start, 'w.end)
val results = windowedTable.toDataSet[Row].print()
}
```
It should be:
```
Hello world,1,3,1970-01-01 00:00:00.005,1970-01-01 00:00:00.01
Hello,2,2,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005
Hello world,1,3,1970-01-01 00:00:00.015,1970-01-01 00:00:00.02
Hi,1,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005
```
But is:
```
Hello,2,2,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005
Hello world,2,3,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005
Hi,1,1,1970-01-01 00:00:00.0,1970-01-01 00:00:00.005
```
---
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.
---