Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/20937#discussion_r178427279 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala --- @@ -2065,29 +2065,238 @@ class JsonSuite extends QueryTest with SharedSQLContext with TestJsonData { } } - def testLineSeparator(lineSep: String): Unit = { - test(s"SPARK-21289: Support line separator - lineSep: '$lineSep'") { - // Read - val data = - s""" - | {"f": - |"a", "f0": 1}$lineSep{"f": - | - |"c", "f0": 2}$lineSep{"f": "d", "f0": 3} - """.stripMargin - val dataWithTrailingLineSep = s"$data$lineSep" - - Seq(data, dataWithTrailingLineSep).foreach { lines => - withTempPath { path => - Files.write(path.toPath, lines.getBytes(StandardCharsets.UTF_8)) - val df = spark.read.option("lineSep", lineSep).json(path.getAbsolutePath) - val expectedSchema = - StructType(StructField("f", StringType) :: StructField("f0", LongType) :: Nil) - checkAnswer(df, Seq(("a", 1), ("c", 2), ("d", 3)).toDF()) - assert(df.schema === expectedSchema) + def testFile(fileName: String): String = { + Thread.currentThread().getContextClassLoader.getResource(fileName).toString + } + + test("SPARK-23723: json in UTF-16 with BOM") { + val fileName = "json-tests/utf16WithBOM.json" + val schema = new StructType().add("firstName", StringType).add("lastName", StringType) + val jsonDF = spark.read.schema(schema) + // This option will be replaced by .option("lineSep", "x00 0a") --- End diff -- No, we don't know this yet. Let's remove this comment and the test.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org