You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Davies Liu (JIRA)" <ji...@apache.org> on 2015/10/13 23:16:05 UTC
[jira] [Comment Edited] (SPARK-10617) Leap year miscalculated in
sql query
[ https://issues.apache.org/jira/browse/SPARK-10617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14955691#comment-14955691 ]
Davies Liu edited comment on SPARK-10617 at 10/13/15 9:15 PM:
--------------------------------------------------------------
If you really want to get 2016-02-28 back, you could do date_add(cast('2015-02-28' as date), 365)
We definitely need different way to get different answer.
was (Author: davies):
If you really want to get 2016-02-28 back, you could do date_add(cast('2015-02-28' as date), 365)
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org