Description
test("invalid json with leading nulls - from dataset") { import testImplicits._ withTempDir { tempDir => val path = tempDir.getAbsolutePath Seq("""{"firstName":"Chris", "lastName":"Baird"}""", """{"firstName":"Doug", "lastName":"Rood"}""").toDS().write.mode("overwrite").text(path) val schema = new StructType().add("a", IntegerType).add("_corrupt_record", StringType) val jsonDF = spark.read.schema(schema).option("mode", "DROPMALFORMED").json(path) checkAnswer(jsonDF, Seq( Row("Chris", "Baird"), Row("Doug", "Rood") )) } }
After this PR it returns a wrong answer.
[null,null] [null,null]
Attachments
Issue Links
- relates to
-
SPARK-23094 Json Readers choose wrong encoding when bad records are present and fail
- Resolved