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

    https://github.com/apache/spark/pull/14371#discussion_r72316399
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala
 ---
    @@ -340,13 +341,15 @@ private[state] class HDFSBackedStateStoreProvider(
     
       private def updateFromDeltaFile(version: Long, map: MapType): Unit = {
         val fileToRead = deltaFile(version)
    -    if (!fs.exists(fileToRead)) {
    -      throw new IllegalStateException(
    -        s"Error reading delta file $fileToRead of $this: $fileToRead does 
not exist")
    -    }
         var input: DataInputStream = null
         try {
    -      input = decompressStream(fs.open(fileToRead))
    +      try {
    --- End diff --
    
    I feel like we can get rid of the nesting of the try here by assigning 
input to the result of the inner try {} you added. If it succeeds, then it 
opens a second try block that ensure the (non-null) input stream is closed.


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