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

    https://github.com/apache/spark/pull/12591#discussion_r60797653
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala
 ---
    @@ -327,6 +380,37 @@ class FileStreamSourceSuite extends 
FileStreamSourceTest with SharedSQLContext {
         Utils.deleteRecursively(tmp)
       }
     
    +  test("read from parquet files with changing schema") {
    +
    +    withTempDirs { case (src, tmp) =>
    +      // Add a file so that we can infer its schema
    +      AddParquetFileData.writeToFile(Seq("value0").toDF("k"), src, tmp)
    +
    +      val fileSource = createFileStreamSource("parquet", 
src.getCanonicalPath)
    +      val parquetData = fileSource.toDF()
    +
    +      require(parquetData.schema === StructType(Seq(StructField("k", 
StringType))))
    +
    +      // After creating DF and before starting stream, add data with 
different schema
    +      // Should not affect the inferred schema any more
    +      AddParquetFileData.writeToFile(Seq("value1").toDF("k"), src, tmp)
    --- End diff --
    
    nit: k -> v


---
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]

Reply via email to