Versions Compared

Key

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

...

Code Block
languagesql
Flink SQL> SELECT NOW(), PROCTIME(), CURRENT_TIMESTAMP, CURRENT_DATE, CURRENT_TIME;
-- output:
+-------------------------+-------------------------+-------------------------+--------------+--------------+
|                   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: 
Code Block
languagesql
Flink SQL> 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);

-- output:
+-------------------------+-------------------------+-------------------------+ 
|            TUMBLE_START |              TUMBLE_END |           count(userId) | 
+-------------------------+-------------------------+-------------------------+ 
|     2020-12-29T00:00:00 |     2020-12-30T00:00:00 |     		  		  100 |
+-------------------------+-------------------------+-------------------------+ 

...

Code Block
languagesql
Flink SQL> SELECT  *
         >    FROM userLog
         >    WHERE date >= CURRENT_DATE;

-- in the query, records earlier than 2020-12-29 will not be output.
+-------------------------+-------------------------+-------------------------+ 
|                    date |                  log_ts |                    user | 
+-------------------------+-------------------------+-------------------------+ 
|             2020-12-29  |     2020-12-29T00:00:00 |     		  		Alice |
+-------------------------+-------------------------+-------------------------+ 
|             2020-12-29  |     2020-12-29T00:00:01 |     		  		  Bob |
+-------------------------+-------------------------+-------------------------+ 
|             2020-12-29  |     2020-12-29T00:00:02 |     		  		  Tom |
+-------------------------+-------------------------+-------------------------+ 
  • int the query 

...

SELECT *

       FROM userLog

      where date >= CURRENT_DATE

...

Test Plan

Will add plan tests, unit tests, window operator harness tests as well as IT tests. 

...