godfreyhe commented on a change in pull request #16215:
URL: https://github.com/apache/flink/pull/16215#discussion_r660590610



##########
File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowAggregateITCase.scala
##########
@@ -206,6 +206,98 @@ class WindowAggregateITCase(
     assertEquals(expected.sorted.mkString("\n"), 
sink.getAppendResults.sorted.mkString("\n"))
   }
 
+  @Test
+  def testEventTimeTumbleWindowWithOffset(): Unit = {
+    val sql =
+      """
+        |SELECT
+        |  `name`,
+        |  window_start,
+        |  window_end,
+        |  COUNT(*),
+        |  SUM(`bigdec`),
+        |  MAX(`double`),
+        |  MIN(`float`),
+        |  COUNT(DISTINCT `string`),
+        |  concat_distinct_agg(`string`)
+        |FROM TABLE(
+        |   TUMBLE(TABLE T1, DESCRIPTOR(rowtime), INTERVAL '1' DAY, INTERVAL 
'8' HOUR))
+        |GROUP BY `name`, window_start, window_end
+      """.stripMargin
+
+    val sink = new TestingAppendSink
+    tEnv.sqlQuery(sql).toAppendStream[Row].addSink(sink)
+    env.execute()
+
+    val expected = Seq(
+      
"a,2020-10-09T08:00,2020-10-10T08:00,6,19.98,5.0,1.0,3,Hi|Comment#1|Comment#2",

Review comment:
       if we remove offset from the above sql, the first line of the result is 
`a,2020-10-10T00:00,2020-10-11T00:00,6,19.98,5.0,1.0,3,Hi|Comment#1|Comment#2`. 
The offset is 8 hours, but the result are 16 hours apart ?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to