You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yuming Wang (JIRA)" <ji...@apache.org> on 2019/07/18 10:23:00 UTC

[jira] [Created] (SPARK-28437) Different format when casting interval type to string type

Yuming Wang created SPARK-28437:
-----------------------------------

             Summary: Different format when casting interval type to string type
                 Key: SPARK-28437
                 URL: https://issues.apache.org/jira/browse/SPARK-28437
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Yuming Wang


*Spark SQL*:
{code:sql}
spark-sql> select cast(INTERVAL '10' SECOND as string);
interval 10 seconds
{code}

*PostgreSQL*:
{code:sql}
postgres=# select substr(version(), 0, 16), cast(INTERVAL '10' SECOND as text);
     substr      |   text
-----------------+----------
 PostgreSQL 11.3 | 00:00:10
(1 row)
{code}

*Vertica*:
{code:sql}
dbadmin=> select version(), cast(INTERVAL '10' SECOND as varchar(255));
              version               | ?column?
------------------------------------+----------
 Vertica Analytic Database v9.1.1-0 | 10
(1 row)
{code}

*Presto*:
{code:sql}
presto> select cast(INTERVAL '10' SECOND as varchar(255));
     _col0
----------------
 0 00:00:10.000
(1 row)
{code}

*Oracle*:
{code:sql}
SQL> select cast(INTERVAL '10' SECOND as varchar(255)) from dual;

CAST(INTERVAL'10'SECONDASVARCHAR(255))
--------------------------------------------------------------------------------
INTERVAL'+00 00:00:10.000000'DAY TO SECOND
{code}





--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org