[ https://issues.apache.org/jira/browse/SPARK-36601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17405993#comment-17405993 ]
Kousuke Saruta commented on SPARK-36601: ---------------------------------------- [~lyytinen] This issue seems resolved in SPARK-36379. In the example case you provided, the result should be one record of null. > 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: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org