Skip to content

Commit a34b875

Browse files
committed
Merge pull request #52 from davidnavas/csd-1.2
SPY-509: Fix commitJob so that it executes only once
2 parents 01f048e + d17d89c commit a34b875

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,13 +1235,13 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
12351235
writer.commit()
12361236
}
12371237

1238-
1238+
lazy val result = writer.commitJob()
12391239
self.context.submitJobWithTaskContext(
12401240
self,
12411241
writeToFile,
12421242
0 until self.partitions.size,
12431243
(_, _: Unit) => {},
1244-
{ writer.commitJob() }
1244+
{ result }
12451245
)
12461246
}
12471247

@@ -1330,12 +1330,13 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
13301330
val jobCommitter = jobFormat.getOutputCommitter(jobTaskContext)
13311331
jobCommitter.setupJob(jobTaskContext)
13321332

1333+
lazy val result = jobCommitter.commitJob(jobTaskContext)
13331334
self.context.submitJobWithTaskContext(
13341335
self,
13351336
writeShard,
13361337
0 until self.partitions.size,
13371338
(_, _:Int) => {},
1338-
{ jobCommitter.commitJob(jobTaskContext) }
1339+
{ result }
13391340
)
13401341
}
13411342

0 commit comments

Comments
 (0)