Max Gekk created SPARK-51562:
--------------------------------

             Summary: Add the time() function
                 Key: SPARK-51562
                 URL: https://issues.apache.org/jira/browse/SPARK-51562
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 4.1.0
            Reporter: Max Gekk


Add new function time() which should cast an expr to TIME. This function is a 
synonym for CAST(expr AS TIME). For details see cast function.

h4. Syntax
{code:sql}
time(expr)
{code}

h4. Arguments
* expr: Any expression that can be cast to TIMESTAMP.

h4. Returns
A TIME.

h4. Examples

{code:sql}
> SELECT time('12:25:13.45');
 12:25:13.45
> SELECT time(timestamp'2020-04-30 12:25:13.45');
 12:25:13.45
> SELECT time(123);
 00:02:03
{code}






--
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