GitHub user HyukjinKwon opened a pull request:

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

    [SPARK-20978][SQL] Bump up Univocity version to 2.5.4

    ## What changes were proposed in this pull request?
    
    There was a bug in Univocity Parser that causes the issue in SPARK-20978. 
This was fixed as below:
    
    ```scala
    val df = spark.read.schema("a string, b string, unparsed 
string").option("columnNameOfCorruptRecord", "unparsed").csv(Seq("a").toDS())
    df.show()
    ```
    
    **Before**
    
    ```
    java.lang.NullPointerException
        at 
scala.collection.immutable.StringLike$class.stripLineEnd(StringLike.scala:89)
        at scala.collection.immutable.StringOps.stripLineEnd(StringOps.scala:29)
        at 
org.apache.spark.sql.execution.datasources.csv.UnivocityParser.org$apache$spark$sql$execution$datasources$csv$UnivocityParser$$getCurrentInput(UnivocityParser.scala:56)
        at 
org.apache.spark.sql.execution.datasources.csv.UnivocityParser$$anonfun$org$apache$spark$sql$execution$datasources$csv$UnivocityParser$$convert$1.apply(UnivocityParser.scala:207)
        at 
org.apache.spark.sql.execution.datasources.csv.UnivocityParser$$anonfun$org$apache$spark$sql$execution$datasources$csv$UnivocityParser$$convert$1.apply(UnivocityParser.scala:207)
    ...
    ```
    
    **After**
    
    ```
    +---+----+--------+
    |  a|   b|unparsed|
    +---+----+--------+
    |  a|null|       a|
    +---+----+--------+
    ```
    
    It was fixed in 2.5.0 and 2.5.4 was released. I guess it'd be safe to 
upgrade this.
    
    ## How was this patch tested?
    
    Unit test added in `CSVSuite.scala`.

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

    $ git pull https://github.com/HyukjinKwon/spark bump-up-univocity

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

    https://github.com/apache/spark/pull/19113.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 #19113
    
----
commit fa7eb514cfd91bb405fd74680b08d5865911e3f0
Author: hyukjinkwon <gurwls...@gmail.com>
Date:   2017-08-26T03:52:40Z

    Bump up Univocity version to 2.5.4

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to