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

lineSep shouldn't be required in JSON write

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • SQL
    • None

    Description

      Currently, the lineSep option is required by JSON datasource in write if encoding is different from UTF-8. For example, the code:

      df.write.option("encoding", "UTF-32BE").json(file)
      

      throws the exception:

      requirement failed: The lineSep option must be specified for the UTF-32BE encoding
      java.lang.IllegalArgumentException: requirement failed: The lineSep option must be specified for the UTF-32BE encoding
      	at scala.Predef$.require(Predef.scala:224)
      	at org.apache.spark.sql.catalyst.json.JSONOptions$$anonfun$32.apply(JSONOptions.scala:118)
      	at org.apache.spark.sql.catalyst.json.JSONOptions$$anonfun$32.apply(JSONOptions.scala:103)
      	at scala.Option.map(Option.scala:146)
      

      The restriction should NOT be applied to writing.

      Attachments

        Activity

          People

            maxgekk Max Gekk
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: