[
https://issues.apache.org/jira/browse/SPARK-19496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15857541#comment-15857541
]
Song Jun edited comment on SPARK-19496 at 2/8/17 7:11 AM:
----------------------------------------------------------
mysql: select str_to_date('2014-12-31','%Y-%d-%m') also return null
that is mysql both return null when the date is invalidate or the formate is
invalidate.
and hive will transform the invalidate date to valid, e.g 2014-31-12 -> 31/12
= 2 -> 2014+2=2016
, 31 - 12*2=7 -> 2016-07-12
was (Author: windpiger):
mysql: select str_to_date('2014-12-31','%Y-%d-%m') also return null
mysql both return null when the date is invalidate or the formate is invalidate
> to_date with format has weird behavior
> --------------------------------------
>
> Key: SPARK-19496
> URL: https://issues.apache.org/jira/browse/SPARK-19496
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.1.0
> Reporter: Wenchen Fan
>
> Today, if we run
> {code}
> SELECT to_date('2015-07-22', 'yyyy-dd-MM')
> {code}
> will result to `2016-10-07`, while running
> {code}
> SELECT to_date('2014-31-12') # default format
> {code}
> will return null.
> this behavior is weird and we should check other systems like hive to see if
> this is expected.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]