Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/14151#discussion_r155139949
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/text/TextSuite.scala
---
@@ -39,6 +39,54 @@ class TextSuite extends QueryTest with SharedSQLContext {
verifyFrame(spark.read.text(testFile))
}
+ test("reading text file with option wholetext=true") {
+ val df = spark.read.option("wholetext", "true")
+ .format("text").load(testFile)
+ // schema
+ assert(df.schema == new StructType().add("value", StringType))
+
+ // verify content
+ val data = df.collect()
+ assert(data(0) ==
+ Row(
+ // scalastyle:off nonascii
+ """This is a test file for the text data source
+ |1+1
+ |æ°æ®ç 头
+ |"doh"
+ |""".stripMargin))
+ // scalastyle:on
--- End diff --
nit: // scalastyle:on nonascii
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]