wangxlong commented on a change in pull request #13427:
URL: https://github.com/apache/flink/pull/13427#discussion_r491767275
##########
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:
Yes, you are right. `TIME` type cannot support offsets larger than one
day. I think we should determine what type is reasonable to use. If `INTERVAL`
is reasonable, we can use `DATETIME_INTERVAL_INTERVA` and
`DATETIME_INTERVAL_INTERVAL_INTERVAL`
##########
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:
I use `INTERVAL` type in this PR
https://github.com/apache/flink/compare/master...wangxlong:FLINK-17767_OFFSET_USE_INTERVAL?expand=1.
----------------------------------------------------------------
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]