Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

From my investigation, to correct this time functions' behavior, we have serveral several options
(1) change the function return type
(2) change the function return value
(3) change them both.

...

After the proposal is finished, the above user cases will work smoothly.  Assume users' local time zone is UTC+8, the wall-clock is 2020-12-29 07:52:52.

  • user case 1: the query 

...

Code Block
languagesql
Flink SQL> SELECT NOW(), PROCTIME(), CURRENT_TIMESTAMP, CURRENT_DATE,

...

 CURRENT_TIME;
+-------------------------+-------------------------+-------------------------+--------------+--------------+
| NOW() | PROCTIME() | CURRENT_TIMESTAMP | CURRENT_DATE | CURRENT_TIME |
+-------------------------+-------------------------+-------------------------+--------------+--------------+
| 2020-12-29T07:52:52 | 2020-12-29T07:52:52 | 2020-12-29T07:52:52 | 2020-12-29 | 07:52:52.236 |
+-------------------------+-------------------------+-------------------------+--------------+--------------+




  • user case 2

...

will output:

| 2020-12-29 07:52:52 | 2020-12-29 07:52:52 | 2020-12-29 | 07:52:52 | 2020-12-29 07:52:52|

  • user case 2: the query 

SELECT 

   TUMBLE_START(proctime, INTERVAL ‘1’ DAY),

   TUMBLE_END(proctime, INTERVAL ‘1’ DAY),

   count(userId) as cnt

       FROM userLog

       GROUP BY TUMBLE_WINDOW(proctime, INTERVAL ‘1’ DAY)

...