Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/3120#discussion_r22778563
--- Diff: core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala ---
@@ -109,18 +109,22 @@ class NewHadoopRDD[K, V](
logInfo("Input split: " + split.serializableHadoopSplit)
val conf = confBroadcast.value.value
- val inputMetrics = new InputMetrics(DataReadMethod.Hadoop)
+ val readMethod = DataReadMethod.Hadoop
--- End diff --
Minor, but I find it slightly easier to follow as a match:
```
val hadoopReadMethod = DataReadMethod.Hadoop
val newMetrics = context.taskMetrics.inputMetrics match {
case Some(InputMetrics(hadoopReadMethod)) =>
context.taskMetrics.inputMetrics
case _ =>
// Note that this may clobber some other input metric (see
SPARK-XXX)
hadoopReadMethod
}
context.taskMetrics.inputMetrics = Some(newMetrics)
```
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]