GitHub user brkyvz opened a pull request:

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

    [SPARK-19543] from_json fails when the input row is empty

    ## What changes were proposed in this pull request?
    
    Using from_json on a column with an empty string results in: 
java.util.NoSuchElementException: head of empty list.
    
    This is because `parser.parse(input)` may return `Nil` when 
`input.trim.isEmpty`
    
    ## How was this patch tested?
    
    Regression test in `JsonExpressionsSuite`

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

    $ git pull https://github.com/brkyvz/spark json-fix

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

    https://github.com/apache/spark/pull/16881.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 #16881
    
----
commit 49401b157f4d40bc2eeab036f96dc997ab31e3df
Author: Burak Yavuz <brk...@gmail.com>
Date:   2017-02-10T03:56:31Z

    fix

commit 6ef0f45bde310f4b09ddbdc796246db03df0c080
Author: Burak Yavuz <brk...@gmail.com>
Date:   2017-02-10T04:08:26Z

    ready for review

----


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