GitHub user sergey-rubtsov opened a pull request:

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

    [SPARK-19228][SQL] Introduce tryParseDate method to process csv date,…

    … add a type-widening rule in findTightestCommonType between DateType and 
TimestampType, add java.time.format.DateTimeFormatter to more accurately infer 
the type of time, add an end-to-end test case and unit test
    
    ## What changes were proposed in this pull request?
    
    By design 'TimestampType' (8 bytes) is larger than 'DateType' (4 bytes).
    But when a date is parsed, an option "dateFormat" is ignored and default 
date format ("yyyy-MM-dd") is using and the date is parsed as timestamp.
    
    This patch fixes that bug.
    
    For other details, please, read the ticket
    https://issues.apache.org/jira/browse/SPARK-19228
    
    ## How was this patch tested?
    
    Add an end-to-end test case and unit test

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

    $ git pull https://github.com/sergey-rubtsov/spark master

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

    https://github.com/apache/spark/pull/20140.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 #20140
    
----
commit d2ed68673082995bee65a3c58be8b71642a60d57
Author: sergei.rubtcov <sergei.rubtcov@...>
Date:   2018-01-03T10:50:26Z

    [SPARK-19228][SQL] Introduce tryParseDate method to process csv date, add a 
type-widening rule in findTightestCommonType between DateType and 
TimestampType, add java.time.format.DateTimeFormatter to more accurately infer 
the type of time, add an end-to-end test case and unit test

----


---

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

Reply via email to