HuangXingBo commented on a change in pull request #16240:
URL: https://github.com/apache/flink/pull/16240#discussion_r656705986



##########
File path: flink-python/pyflink/table/tests/test_udaf.py
##########
@@ -543,24 +543,25 @@ def test_tumbling_group_window_over_time(self):
 
         from pyflink.testing import source_sink_utils
         table_sink = source_sink_utils.TestAppendSink(
-            ['a', 'b', 'c', 'd'],
+            ['a', 'b', 'c', 'd', 'e'],
             [
                 DataTypes.TINYINT(),
                 DataTypes.TIMESTAMP(3),
                 DataTypes.TIMESTAMP(3),
+                DataTypes.BIGINT(),
                 DataTypes.BIGINT()])
         self.t_env.register_table_sink("Results", table_sink)
         t.window(Tumble.over("1.hours").on("rowtime").alias("w")) \
             .group_by("a, w") \
-            .select("a, w.start, w.end, my_count(c) as c") \
+            .select("a, w.start, w.end, COUNT(c) as c, my_count(c) as d") \
             .execute_insert("Results") \
             .wait()
         actual = source_sink_utils.results()
         self.assert_equals(actual,
-                           ["+I[2, 2018-03-11 03:00:00.0, 2018-03-11 
04:00:00.0, 1]",
-                            "+I[3, 2018-03-11 03:00:00.0, 2018-03-11 
04:00:00.0, 1]",
-                            "+I[1, 2018-03-11 03:00:00.0, 2018-03-11 
04:00:00.0, 2]",
-                            "+I[1, 2018-03-11 04:00:00.0, 2018-03-11 
05:00:00.0, 1]"])
+                           ["+I[2, 2018-03-11 03:00:00.0, 2018-03-11 
04:00:00.0, 2, 1]",

Review comment:
       In fact, the user-defined udaf is a count(distinct). so the result is 
expected.




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


Reply via email to