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

Max Gekk resolved SPARK-57558.
------------------------------
    Fix Version/s: 4.3.0
       Resolution: Fixed

Issue resolved by pull request 56766
[https://github.com/apache/spark/pull/56766]

> Add the LOCALTIME datetime value function
> -----------------------------------------
>
>                 Key: SPARK-57558
>                 URL: https://issues.apache.org/jira/browse/SPARK-57558
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 4.3.0
>            Reporter: Max Gekk
>            Assignee: Max Gekk
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.3.0
>
>
> h2. What
> Add the ANSI {{LOCALTIME}} datetime value function, returning the current 
> local time as
> {{TIME}} (without time zone), with an optional precision argument 
> {{LOCALTIME(p)}}.
> h2. Why
> ANSI SQL (6.32 <datetime value function>) defines both {{CURRENT_TIME}} (TIME 
> WITH TIME
> ZONE) and {{LOCALTIME}} (TIME WITHOUT TIME ZONE). Spark registers 
> {{current_time}},
> {{current_timestamp}}, and {{localtimestamp}}, but not {{localtime}}. Since 
> Spark's TIME is
> always WITHOUT TIME ZONE, {{LOCALTIME}} is the standard-named counterpart to 
> the existing
> {{localtimestamp}}.
> h2. Scope
> * Register {{localtime}} in {{FunctionRegistry}} next to 
> {{current_time}}/{{localtimestamp}}.
> * Implement as an expression returning {{TimeType(p)}} from the session-local 
> wall clock
>   (reuse the {{CurrentTime}} implementation / constant-folding in 
> {{finishAnalysis}}).
> * Parser support for the reserved-word form {{LOCALTIME}} (no parentheses), 
> consistent with
>   {{LOCALTIMESTAMP}}.
> h2. Acceptance criteria
> * {{SELECT LOCALTIME}}, {{SELECT LOCALTIME()}}, {{SELECT localtime(3)}} all 
> return TIME at
>   the requested precision.
> * Documented in the function reference; tests added.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to