You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jussi Lyytinen (Jira)" <ji...@apache.org> on 2021/08/26 13:47:00 UTC

[jira] [Updated] (SPARK-36601) Reading a valid JSON file causes a NPE

     [ https://issues.apache.org/jira/browse/SPARK-36601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jussi Lyytinen updated SPARK-36601:
-----------------------------------
    Attachment: stacktrace.txt

> Reading a valid JSON file causes a NPE
> --------------------------------------
>
>                 Key: SPARK-36601
>                 URL: https://issues.apache.org/jira/browse/SPARK-36601
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 3.1.2
>            Reporter: Jussi Lyytinen
>            Priority: Major
>         Attachments: stacktrace.txt
>
>
> Executing the following Scala code:
> {code:java}
> spark.read.option("multiLine", true).json("/mnt/reproduce/test.json").show
> {code}
> Using the following data in test.json:
> {code:java}
> [
>   {"value": 42},
>   {"value": 43},
>   null,
>   {"value": 44}
> ]
> {code}
> Causes the following failure:
> {code:java}
> Job aborted due to stage failure.
> Caused by: FileReadException: Error while reading file dbfs:/mnt/reproduce/test.json.
> Caused by: NullPointerException:
> {code}
> The documentation is not clear about the expected behavior but my personal expectation would be to get this instead of complete failure:
> {code:java}
> +-----+
> |value|
> +-----+
> |   42|
> |   43|
> | null|
> |   44|
> +-----+
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org