Skip to content

Commit 285a663

Browse files
committed
[SPARK-12056][CORE] Part 2 Create a TaskAttemptContext only after calling setConf
1 parent 04b6799 commit 285a663

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SqlNewHadoopRDD.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ private[spark] class SqlNewHadoopRDD[V: ClassTag](
148148
}
149149
inputMetrics.setBytesReadCallback(bytesReadCallback)
150150

151-
val attemptId = newTaskAttemptID(jobTrackerId, id, isMap = true, split.index, 0)
152-
val hadoopAttemptContext = newTaskAttemptContext(conf, attemptId)
153151
val format = inputFormatClass.newInstance
154152
format match {
155153
case configurable: Configurable =>
156154
configurable.setConf(conf)
157155
case _ =>
158156
}
157+
val attemptId = newTaskAttemptID(jobTrackerId, id, isMap = true, split.index, 0)
158+
val hadoopAttemptContext = newTaskAttemptContext(conf, attemptId)
159159
private[this] var reader: RecordReader[Void, V] = null
160160

161161
/**

0 commit comments

Comments
 (0)