You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "davon.cao (Jira)" <ji...@apache.org> on 2022/02/28 01:26:00 UTC

[jira] [Created] (SPARK-38341) Spark sql - Function of add_ Months returns an incorrect date

davon.cao created SPARK-38341:
---------------------------------

             Summary: Spark sql - Function of add_ Months returns an incorrect date
                 Key: SPARK-38341
                 URL: https://issues.apache.org/jira/browse/SPARK-38341
             Project: Spark
          Issue Type: Bug
          Components: Spark Submit
    Affects Versions: 3.2.1
            Reporter: davon.cao


Step to reproduce:

Version of spark sql: 3.2.1(latest  version in maven repository)

Run sql:

spark.sql("""SELECT ADD_MONTHS(last_day('2020-06-30'), -1)""").toPandas()

expect: 2020-05-31

actual: 2020-05-30 

 

Version of spark sql: 2.4.3

spark.sql("""SELECT ADD_MONTHS(last_day('2020-06-30'), -1)""").toPandas()

expect: 2020-05-31 

actual: 2020-05-31

 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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