[
https://issues.apache.org/jira/browse/SPARK-36601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hyukjin Kwon resolved SPARK-36601.
----------------------------------
Resolution: Duplicate
> 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 an exception:
> {code:java}
> +-----+
> |value|
> +-----+
> | 42|
> | 43|
> | null|
> | 44|
> +-----+
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]