cloud-fan commented on a change in pull request #21164: [SPARK-24098][SQL] 
ScriptTransformationExec should wait process exiting before output iterator 
finish
URL: https://github.com/apache/spark/pull/21164#discussion_r324996695
 
 

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala
 ##########
 @@ -137,13 +137,12 @@ case class ScriptTransformationExec(
             throw writerThread.exception.get
           }
 
-          if (!proc.isAlive) {
-            val exitCode = proc.exitValue()
-            if (exitCode != 0) {
-              logError(stderrBuffer.toString) // log the stderr circular buffer
-              throw new SparkException(s"Subprocess exited with status 
$exitCode. " +
-                s"Error: ${stderrBuffer.toString}", cause)
-            }
+          proc.waitFor()
 
 Review comment:
   You didn't answer my question. It looks more natural to wait for the process 
then call `writerThread.exception` according to what you said.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to