Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/5940#discussion_r186033401 --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/stream/sql/SqlITCase.scala --- @@ -52,6 +52,76 @@ class SqlITCase extends StreamingWithStateTestBase { (8000L, "8", "Hello World"), (20000L, "20", "Hello World")) + @Test + def testDistinctAggWithMergeOnEventTimeSessionGroupWindow(): Unit = { + // create a watermark with 10ms offset to delay the window emission by 10ms to verify merge + val sessionWindowTestdata = List( + (1L, 1, "Hello"), --- End diff -- The test is not checking for DISTINCT semantics since all aggregated values are distinct. We could do `COUNT(DISTINCT num)` (`int` has to be renamed to `num` because its a SQL keyword).
---