GitHub user wangyang1992 opened a pull request:

    https://github.com/apache/spark/pull/13169

    [SPARK-15379][SQL] check special invalid date

    ## What changes were proposed in this pull request?
    
    When invalid date string like "2015-02-29 00:00:00" are cast as date or 
timestamp using spark sql, it used to not return null but another valid date 
(2015-03-01 in this case). 
    In this pr, invalid date string like "2016-02-29" and "2016-04-31" are 
returned as null when cast as date or timestamp.
    
    ## How was this patch tested?
    
    Unit tests are added.
    
    
    (If this patch involves UI changes, please attach a screenshot; otherwise, 
remove this)
    
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/wangyang1992/spark invalid_date

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13169.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13169
    
----
commit ef73d79bacc2eab8cbead7aa8991b4ec7de3b862
Author: wangyang <[email protected]>
Date:   2016-05-18T10:04:14Z

    check special invalid date

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to