[
https://issues.apache.org/jira/browse/SPARK-28437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16981050#comment-16981050
]
Kent Yao commented on SPARK-28437:
----------------------------------
We're able to use `spark.sql.intervalOutputStyle` to change this behavior now
since Spark 3.0
> 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
> Priority: Major
>
> *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
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]