Skip to content

Commit

Permalink
SPARK-6045 RecordWriter should be checked against null in PairRDDFunc…
Browse files Browse the repository at this point in the history
…tions#saveAsNewAPIHadoopDataset
  • Loading branch information
tedyu committed Feb 26, 2015
1 parent 7fa960e commit 2d8d4b1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,9 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
recordsWritten += 1
}
} finally {
writer.close(hadoopContext)
if (writer != null) {
writer.close(hadoopContext)
}
}
committer.commitTask(hadoopContext)
bytesWrittenCallback.foreach { fn => outputMetrics.setBytesWritten(fn()) }
Expand Down

0 comments on commit 2d8d4b1

Please sign in to comment.