Fixed a bug for zero partition in JobWaiter.
Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/9f8190c1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/9f8190c1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/9f8190c1 Branch: refs/heads/master Commit: 9f8190c17d19d9149f20fc3c879dee9e6ab7b8ec Parents: 9332246 Author: Reynold Xin <reyno...@gmail.com> Authored: Wed Sep 18 22:42:35 2013 -0700 Committer: Reynold Xin <reyno...@gmail.com> Committed: Wed Sep 18 22:42:35 2013 -0700 ---------------------------------------------------------------------- core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/9f8190c1/core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala ---------------------------------------------------------------------- diff --git a/core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala b/core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala index 290dcc8..95c2ec7 100644 --- a/core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala +++ b/core/src/main/scala/org/apache/spark/scheduler/JobWaiter.scala @@ -35,8 +35,9 @@ private[spark] class JobWaiter[T]( def jobFinished = _jobFinished - // If the job is finished, this will be its result - private var jobResult: JobResult = null + // If the job is finished, this will be its result. In the case of 0 task jobs (e.g. zero + // partition RDDs), we set the jobResult directly to JobSucceeded. + private var jobResult: JobResult = if (jobFinished) JobSucceeded else null def kill() { dagScheduler.killJob(jobId)