Github user HyukjinKwon commented on a diff in the pull request:
    --- Diff: 
    @@ -146,29 +146,32 @@ object SparkHadoopMapReduceWriter extends Logging {
           case c: Configurable => c.setConf(hadoopConf)
           case _ => ()
    -    val writer = taskFormat.getRecordWriter(taskContext)
    -      .asInstanceOf[RecordWriter[K, V]]
    -    require(writer != null, "Unable to obtain RecordWriter")
         var recordsWritten = 0L
         // Write all rows in RDD partition.
         try {
           val ret = Utils.tryWithSafeFinallyAndFailureCallbacks {
    -        while (iterator.hasNext) {
    -          val pair =
    -          writer.write(pair._1, pair._2)
    -          // Update bytes written metric every few records
    -          SparkHadoopWriterUtils.maybeUpdateOutputMetrics(
    -            outputMetricsAndBytesWrittenCallback, recordsWritten)
    -          recordsWritten += 1
    +        val writer = taskFormat.getRecordWriter(taskContext)
    --- End diff --
    I was a bit worried of moving this in here because we now abort the task 
when it fails to create a record reader. Just to convince myself, I at least 
checked `FileSystem.create(..)` is called within 
`TextOutputFormat.getRecordWriter` and it seems removed via 

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to