Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package org.apache.spark.sql.execution.datasources
import java.util.Date

import org.apache.spark.{SparkException, TaskContext}
import org.apache.spark.internal.io.FileCommitProtocol
import org.apache.spark.internal.io.{FileCommitProtocol, SparkHadoopWriterUtils}
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.Attribute
Expand Down Expand Up @@ -72,15 +72,15 @@ case class WriteFilesExec(child: SparkPlan) extends UnaryExecNode {
val concurrentOutputWriterSpec = writeFilesSpec.concurrentOutputWriterSpecFunc(child)
val description = writeFilesSpec.description
val committer = writeFilesSpec.committer
val jobIdInstant = new Date().getTime
val jobTrackerID = SparkHadoopWriterUtils.createJobTrackerID(new Date())
rddWithNonEmptyPartitions.mapPartitionsInternal { iterator =>
val sparkStageId = TaskContext.get().stageId()
val sparkPartitionId = TaskContext.get().partitionId()
val sparkAttemptNumber = TaskContext.get().taskAttemptId().toInt & Int.MaxValue

val ret = FileFormatWriter.executeTask(
description,
jobIdInstant,
jobTrackerID,
sparkStageId,
sparkPartitionId,
sparkAttemptNumber,
Expand Down