Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/17596#discussion_r112474482
--- Diff: core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
---
@@ -308,16 +305,17 @@ private[spark] object TaskMetrics extends Logging {
*/
def fromAccumulators(accums: Seq[AccumulatorV2[_, _]]): TaskMetrics = {
val tm = new TaskMetrics
- val (internalAccums, externalAccums) =
- accums.partition(a => a.name.isDefined &&
tm.nameToAccums.contains(a.name.get))
-
- internalAccums.foreach { acc =>
- val tmAcc =
tm.nameToAccums(acc.name.get).asInstanceOf[AccumulatorV2[Any, Any]]
- tmAcc.metadata = acc.metadata
- tmAcc.merge(acc.asInstanceOf[AccumulatorV2[Any, Any]])
+ for (acc <- accums) {
+ val name = AccumulatorContext.get(acc.id).flatMap(_.name)
--- End diff --
This code is here 4 times. I am wondering if we should remove name from
accumulator metadata and just implement `accumulator.name` using this function.
---
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]