aboutsummaryrefslogtreecommitdiff
path: root/sql/core
diff options
context:
space:
mode:
authorYin Huai <yhuai@databricks.com>2015-05-13 23:36:19 +0800
committerCheng Lian <lian@databricks.com>2015-05-13 23:36:19 +0800
commitb061bd517a3dc26e7f37a334f49c3465d98334c6 (patch)
treefd14982a1857293bdc7af64d44234584865ad106 /sql/core
parent10c546e9d42a0f3fbf45c919e74f62c548ca8347 (diff)
downloadspark-b061bd517a3dc26e7f37a334f49c3465d98334c6.tar.gz
spark-b061bd517a3dc26e7f37a334f49c3465d98334c6.tar.bz2
spark-b061bd517a3dc26e7f37a334f49c3465d98334c6.zip
[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 <yhuai@databricks.com> Closes #6105 from yhuai/logCause and squashes the following commits: 8dfe0d8 [Yin Huai] Log cause.
Diffstat (limited to 'sql/core')
-rw-r--r--sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala2
1 files changed, 2 insertions, 0 deletions
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 fe8be5b7fe..a294297677 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)
}