Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
The value of time function CURRENT_TIMESTAMP and NOW() are corrected from UTC time with `TIMESTAMP` type to epoch time with `TIMESTAMP_LTZ` type. Time function LOCALTIME, LOCALTIMESTAMP, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP and NOW() are corrected from evaluates for per record in batch mode to evaluate once at query-start for batch job.
The value of time function CURRENT_TIMESTAMP and NOW() are corrected from UTC time with `TIMESTAMP` type to epoch time with `TIMESTAMP_LTZ` type. Time function LOCALTIME, LOCALTIMESTAMP, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP and NOW() are corrected from evaluates for per record in batch mode to evaluate once at query-start for batch job.
Description
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.
Attachments
Issue Links
- links to