Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-23428

Revert [SPARK-23094] Fix invalid character handling in JsonDataSource

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Invalid
    • Affects Version/s: 2.3.0
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None
    • Target Version/s:

      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

            Activity

              People

              • Assignee:
                smilegator Xiao Li
                Reporter:
                smilegator Xiao Li
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: