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

    https://github.com/apache/spark/pull/13834#discussion_r69576697
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformation.scala
 ---
    @@ -312,17 +312,17 @@ private class ScriptTransformationWriterThread(
               }
             }
           }
    +      Utils.tryLogNonFatalError(outputStream.close())
           threwException = false
         } catch {
    -      case NonFatal(e) =>
    +      case e @ Throwable =>
             // An error occurred while writing input, so kill the child 
process. According to the
             // Javadoc this call will not throw an exception:
             _exception = e
             proc.destroy()
             throw e
         } finally {
           try {
    -        outputStream.close()
    --- End diff --
    
    Hm, I mean, before this was safe in that we'd always close the stream, or 
try to. The problem was just that closing could throw an exception and skip 
printing the stderr buffer. I don't see the value in moving close() just to 
have to further change the method behavior to work around the move. Why not 
just leave it here but prevent an exception from being thrown from close?


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