Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13727#discussion_r67575918
  
    --- 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)
    +    assert(spark.read.schema(userSchema).text(input).schema === userSchema)
    +    assert(spark.read.schema(userSchema).text(input, input, input).schema 
=== userSchema)
    +    assert(spark.read.schema(userSchema).text(Seq(input, input): 
_*).schema === userSchema)
    +
    +    // Writer
    +    spark.read.text().write.text(output)
    +  }
    +
    +  test("textFile - API and common behavior") {
    +    // Reader, without user specified schema
    +    assert(spark.read.textFile().schema === textSchema)
    +    assert(spark.read.textFile(input).schema === textSchema)
    +    assert(spark.read.textFile(input, input, input).schema === textSchema)
    +    assert(spark.read.textFile(Seq(input, input): _*).schema === 
textSchema)
    --- End diff --
    
    What happens if you specify a schema here?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to