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.