[ 
https://issues.apache.org/jira/browse/FLINK-21713?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Leonard Xu updated FLINK-21713:
-------------------------------
    Environment: 
* 1.The CURRENT_TIMESTAMP function returned timestamp of UTC+0 timezone with 
TIMESTAMP type, now it's corrected to return timestamp of local time zone with  
TIMESTAMP_LTZ type.
* 2. Time function LOCALTIME, LOCALTIMESTAMP, CURRENT_DATE, CURRENT_TIME, 
CURRENT_TIMESTAMP, NOW() were evaluated for per record no matter the job is 
stream or batch. Now, it is corrected to evaluate for per record in stream job, 
evaluate once at query-start for batch job.

  was:
* 1.The CURRENT_TIMESTAMP function returned timestamp of UTC+0 timezone with 
TIMESTAMP type, now it's corrected to return timestamp of local time zone with  
TIMESTAMP_LTZ type.
* 2. Time function LOCALTIME, LOCALTIMESTAMP, CURRENT_DATE, CURRENT_TIME, 
CURRENT_TIMESTAMP, NOW() was evaluated for per record no matter the job is 
stream or batch. Now, it is corrected to evaluate for per record in stream job, 
evaluate once at query-start for batch job.


> 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
>         Environment: * 1.The CURRENT_TIMESTAMP function returned timestamp of 
> UTC+0 timezone with TIMESTAMP type, now it's corrected to return timestamp of 
> local time zone with  TIMESTAMP_LTZ type.
> * 2. Time function LOCALTIME, LOCALTIMESTAMP, CURRENT_DATE, CURRENT_TIME, 
> CURRENT_TIMESTAMP, NOW() were evaluated for per record no matter the job is 
> stream or batch. Now, it is corrected to evaluate for per record in stream 
> job, evaluate once at query-start for batch job.
>            Reporter: Leonard Xu
>            Assignee: Leonard Xu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.13.0
>
>
> 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)

Reply via email to