You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Zhu, Lipeng (JIRA)" <ji...@apache.org> on 2019/06/26 12:45:00 UTC

[jira] [Created] (SPARK-28171) Correct interval type conversion behavior

Zhu, Lipeng created SPARK-28171:
-----------------------------------

             Summary: Correct interval type conversion behavior 
                 Key: SPARK-28171
                 URL: https://issues.apache.org/jira/browse/SPARK-28171
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Zhu, Lipeng


When calculate between date and interval.
{code:sql}
select timestamp '2019-01-01 00:00:00' + interval '1 2:03:04' day to second, timestamp '2019-01-01 00:00:00' + interval '-1 2:03:04' day to second
{code}
 * PostgreSQL return *2019-01-02 02:03:04*    *2018-12-31 02:03:04*
 * SparkSQL return    *2019-01-02 02:03:04*    *2018-12-30 21:56:56*

{code:sql}
select timestamp '2019-01-01 00:00:00' + interval '1 -2:03:04' day to second, timestamp '2019-01-01 00:00:00' + interval '-1 -2:03:04' day to second
{code}
 * PostgreSQL return *2019-01-01 21:56:56*    *2018-12-30 21:56:56*
 * SparkSQL return    _*Interval string does not match day-time format of 'd h:m:s.n': '1 -2:03:04'(line 1, pos 50)*_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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