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

    https://github.com/apache/spark/pull/20382#discussion_r167128691
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala 
---
    @@ -177,11 +177,14 @@ final class DataStreamReader 
private[sql](sparkSession: SparkSession) extends Lo
               Optional.ofNullable(userSpecifiedSchema.orNull),
               Utils.createTempDir(namePrefix = 
s"temporaryReader").getCanonicalPath,
               options)
    +        val schema = tempReader.readSchema()
    +        // Stop tempReader to avoid side-affect thing
    +        tempReader.stop()
    --- End diff --
    
    i feel like this needs a try finally approach as well.


---

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

Reply via email to