You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2016/07/05 14:51:33 UTC

[GitHub] spark pull request #13834: [SPARK-16339] [CORE] ScriptTransform does not pri...

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

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