GitHub user HyukjinKwon opened a pull request:

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

    [SPARK-21263][SQL] Do not allow partially parsing double and floats via 
NumberFormat in CSV

    ## What changes were proposed in this pull request?
    
    This PR proposes to remove `NumberFormat.parse` use to disallow a case of 
partially parsed data. For example,
    
    ```
    scala> spark.read.schema("a DOUBLE").option("mode", 
"FAILFAST").csv(Seq("10u12").toDS).show()
    +----+
    |   a|
    +----+
    |10.0|
    +----+
    ```
    
    ## How was this patch tested?
    
    Unit tests added in `UnivocityParserSuite` and `CSVSuite`.


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

    $ git pull https://github.com/HyukjinKwon/spark SPARK-21263

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

    https://github.com/apache/spark/pull/18532.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 #18532
    
----
commit 024dfccaf8969edb8f1bc719063d3bc97ebff64b
Author: hyukjinkwon <[email protected]>
Date:   2017-07-04T23:35:46Z

    Do not allow partially parsing double and floats via NumberFormat in CSV

----


---
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