Leonard Xu created FLINK-21713:
----------------------------------
Summary: Correct function CURRENT_TIMESTAMP/CURRENT_TIME/CURRENT_DATE/NOW/LOCALTIME/LOCALTIMESTAMP
Key: FLINK-21713
URL:
https://issues.apache.org/jira/browse/FLINK-21713 Project: Flink
Issue Type: Sub-task
Components: Table SQL / API
Reporter: Leonard Xu
1. fix the return value type as well the return value for following time functions
|*function*|*existed problem*|*current behavior*|*proposed changes*|
|CURRENT_DATE|returns UTC date, but user expects current date in session time zone|return type: DATE
#session timezone: UTC
2020-12-28
#session timezone: UTC+8
2020-12-28| return current date in session time zone, the return type should be *DATE*
#session timezone: UTC
2020-12-28
#session timezone: UTC+8
2020-12-29|
|CURRENT_TIME|returns UTC time, but user expects current time in session time zone|return type: TIME
#session timezone: UTC
23:52:52
#session timezone: UTC+8
23:52:52|return current time in session time zone, the return type should be *TIME*
#session timezone: UTC
23:52:52
#session timezone: UTC+8
07:52:52|
|CURRENT_TIMESTAMP|returns UTC timestamp, but user expects current timestamp in session time zone|
return type: TIMESTAMP
#session timezone: UTC
2020-12-28 23:52:52
#session timezone: UTC+8
2020-12-28 23:52:52|return current timestamp in session time zone, the return type should be
*TIMESTAMP WITH LOCAL TIME ZONE*
#session timezone: UTC
2020-12-28 23:52:52
#session timezone: UTC+8
2020-12-29 07:52:52|
|NOW()|returns UTC timestamp, but user expects current timestamp in session time zone|
return type: TIMESTAMP
#session timezone: UTC
2020-12-28 23:52:52
#session timezone: UTC+8
2020-12-28 23:52:52|return current timestamp in session time zone, the return type should be
*TIMESTAMP WITH LOCAL TIME ZONE*
#session timezone: UTC
2020-12-28 23:52:52
#session timezone: UTC+8
2020-12-29 07:52:52|
2. The following functions' evaluation is depend on execution mode
* LOCALTIME
* LOCALTIMESTAMP
* CURRENT_DATE
* CURRENT_TIME
* CURRENT_TIMESTAMP
* NOW()
Flink evaluates above time function values according to execution mode, i.e. Flink evaluates time function value for row level in Streaming mode, evaluates the time function value at query start for batch mode.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)