Repository: spark
Updated Branches:
  refs/heads/branch-1.4 cb1fe8133 -> 9ca28d9de


[SQL] In InsertIntoFSBasedRelation.insert, log cause before abort job/task.

We need to add a log entry before calling `abortTask`/`abortJob`. Otherwise, an 
exception from `abortTask`/`abortJob` will shadow the real cause.

cc liancheng

Author: Yin Huai <[email protected]>

Closes #6105 from yhuai/logCause and squashes the following commits:

8dfe0d8 [Yin Huai] Log cause.

(cherry picked from commit b061bd517a3dc26e7f37a334f49c3465d98334c6)
Signed-off-by: Cheng Lian <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9ca28d9d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9ca28d9d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9ca28d9d

Branch: refs/heads/branch-1.4
Commit: 9ca28d9de6cbc2663fa02ece4f122e2d71322c33
Parents: cb1fe81
Author: Yin Huai <[email protected]>
Authored: Wed May 13 23:36:19 2015 +0800
Committer: Cheng Lian <[email protected]>
Committed: Wed May 13 23:36:36 2015 +0800

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/sql/sources/commands.scala     | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/9ca28d9d/sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala
----------------------------------------------------------------------
diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala 
b/sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala
index fe8be5b..a294297 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala
@@ -121,6 +121,7 @@ private[sql] case class InsertIntoFSBasedRelation(
       writerContainer.commitJob()
       relation.refresh()
     } catch { case cause: Throwable =>
+      logError("Aborting job.", cause)
       writerContainer.abortJob()
       throw new SparkException("Job aborted.", cause)
     }
@@ -143,6 +144,7 @@ private[sql] case class InsertIntoFSBasedRelation(
         }
         writerContainer.commitTask()
       } catch { case cause: Throwable =>
+        logError("Aborting task.", cause)
         writerContainer.abortTask()
         throw new SparkException("Task failed while writing rows.", cause)
       }


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

Reply via email to