wuchong commented on a change in pull request #13427:
URL: https://github.com/apache/flink/pull/13427#discussion_r492461768
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowAggregateITCase.scala
##########
@@ -347,6 +347,83 @@ class WindowAggregateITCase(mode: StateBackendMode)
assertEquals(expected.sorted, sink.getAppendResults.sorted)
}
+ @Test
+ def testEventTimeTumblingWindowWithOffset(): Unit = {
+ val stream = failingDataSource(data)
+ .assignTimestampsAndWatermarks(
+ new TimestampAndWatermarkWithOffset
+ [(Long, Int, Double, Float, BigDecimal, String, String)](10L))
+ val table = stream.toTable(tEnv,
+ 'rowtime.rowtime, 'int, 'double, 'float, 'bigdec, 'string, 'name)
+ tEnv.registerTable("T1", table)
+
+ val sql =
+ """
+ |SELECT
+ | `string`,
+ | TUMBLE_START(rowtime, INTERVAL '0.005' SECOND, TIME '00:00:00.003'),
Review comment:
Personally, I don't see a strong need for `INTERVAL`. I think the offset
is used for time zone offset, so it shoudn't larger than day.
cc @danny0405 , do you think the reason why Calcite use TIME type for the
offset argument?
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowAggregateITCase.scala
##########
@@ -347,6 +347,83 @@ class WindowAggregateITCase(mode: StateBackendMode)
assertEquals(expected.sorted, sink.getAppendResults.sorted)
}
+ @Test
+ def testEventTimeTumblingWindowWithOffset(): Unit = {
+ val stream = failingDataSource(data)
+ .assignTimestampsAndWatermarks(
+ new TimestampAndWatermarkWithOffset
+ [(Long, Int, Double, Float, BigDecimal, String, String)](10L))
+ val table = stream.toTable(tEnv,
+ 'rowtime.rowtime, 'int, 'double, 'float, 'bigdec, 'string, 'name)
+ tEnv.registerTable("T1", table)
+
+ val sql =
+ """
+ |SELECT
+ | `string`,
+ | TUMBLE_START(rowtime, INTERVAL '0.005' SECOND, TIME '00:00:00.003'),
Review comment:
Personally, I don't see a strong need for `INTERVAL`. I think the offset
is used for time zone offset, so it shoudn't larger than day.
cc @danny0405 , do you know the reason why Calcite use TIME type for the
offset argument?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]