Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/13727#discussion_r67572585
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
---
@@ -228,4 +220,101 @@ class DataFrameReaderWriterSuite extends QueryTest
with SharedSQLContext {
}
}
}
+
+ test("load API") {
+ spark.read.format("org.apache.spark.sql.test").load()
+ spark.read.format("org.apache.spark.sql.test").load(input)
+ spark.read.format("org.apache.spark.sql.test").load(input, input,
input)
+ spark.read.format("org.apache.spark.sql.test").load(Seq(input, input):
_*)
+ Option(input).map(spark.read.format("org.apache.spark.sql.test").load)
+ }
+
+ test("text - API and common behavior") {
+ // Reader, without user specified schema
+ assert(spark.read.text().schema === textSchema)
+ assert(spark.read.text(input).schema === textSchema)
+ assert(spark.read.text(input, input, input).schema === textSchema)
+ assert(spark.read.text(Seq(input, input): _*).schema === textSchema)
+ assert(Option(input).map(spark.read.text).get.schema === textSchema)
// SPARK-16009
+
+ // Reader, with user specified schema
+ assert(spark.read.schema(userSchema).text().schema === userSchema)
--- End diff --
I'm not sure what it means to read text with a user specified schema. In
fact, this can't actually work if there was data and you call `collect()`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]