LuciferYang commented on a change in pull request #22149:
[SPARK-25158][SQL]Executor accidentally exit because
ScriptTransformationWriterThread throw Exception.
URL: https://github.com/apache/spark/pull/22149#discussion_r255399388
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
##########
@@ -2348,4 +2354,30 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils
with TestHiveSingleton {
}
}
+ test("SPARK-25158: " +
+ "Executor accidentally exit because ScriptTransformationWriterThread throw
Exception") {
+ withSQLConf("hive.script.recordwriter" ->
+ classOf[NonWritableRecordWriter].getCanonicalName) {
Review comment:
@cloud-fan Now run this case we can see expected log as follwing:
```
23:32:45.800 ERROR
org.apache.spark.sql.hive.execution.ScriptTransformationWriterThread:
Thread-ScriptTransformation-Feed exit cause by:
org.apache.spark.SparkException: Failed to execute user defined
function(SQLQuerySuite$$Lambda$754/1644529474: (int) => int)
at
org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(generated.java:106)
at
org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
at
org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$2.hasNext(WholeStageCodegenExec.scala:730)
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:458)
at scala.collection.Iterator.foreach(Iterator.scala:941)
at scala.collection.Iterator.foreach$(Iterator.scala:941)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
at
org.apache.spark.sql.hive.execution.ScriptTransformationWriterThread.$anonfun$run$1(ScriptTransformationExec.scala:281)
at
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at org.apache.spark.util.Utils$.logUncaughtExceptions(Utils.scala:1899)
at
org.apache.spark.sql.hive.execution.ScriptTransformationWriterThread.run(ScriptTransformationExec.scala:270)
Caused by: java.lang.RuntimeException: Failed to produce data.
at
org.apache.spark.sql.hive.execution.SQLQuerySuite.$anonfun$new$458(SQLQuerySuite.scala:2370)
at
scala.runtime.java8.JFunction1$mcII$sp.apply(JFunction1$mcII$sp.java:23)
at
org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(generated.java:104)
... 10 more
```
and `uncaughtExceptionHandler` catch nothing, use the original code
`uncaughtExceptionHandler` will catch a `SparkException`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]