[ https://issues.apache.org/jira/browse/SPARK-10617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davies Liu resolved SPARK-10617. -------------------------------- Resolution: Not A Problem This is expected behavior, see https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions004.htm If date is the last day of the month or if the resulting month has fewer days than the day component of date, then the result is the last day of the resulting month. Otherwise, the result has the same day component as date. > Leap year miscalculated in sql query > ------------------------------------ > > Key: SPARK-10617 > URL: https://issues.apache.org/jira/browse/SPARK-10617 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 1.5.0, 1.5.1, 1.6.0 > Reporter: shao lo > > -- This is wrong...returns 2016-03-01 > select date_add(add_months(cast('2015-02-28' as date), 1 * 12), 1) > -- This is right...returns 2016-02-29 > select date_add(cast('2016-02-28' as date), 1) -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org