From 80d6651cf6a1835d0de3e12e08253d2a9816d499 Mon Sep 17 00:00:00 2001 From: Julek Sompolski Date: Wed, 25 Sep 2024 23:34:23 +0800 Subject: [PATCH] [SPARK-48195][FOLLOWUP] Accumulator reset() no longer needed in CollectMetricsExec.doExecute() ### What changes were proposed in this pull request? Small followup to https://github.com/apache/spark/pull/48037. `collector.reset()` is no longer needed in `CollectMetricsExec.doExecute()` because it is reset in `resetMetrics()`. This doesn't really matter in practice, but removing to clean up. ### Why are the changes needed? Tiny cleanup. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? This change doesn't matter in practice. Just cleanup. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #48243 from juliuszsompolski/SPARK-48195-followup. Authored-by: Julek Sompolski Signed-off-by: Wenchen Fan --- .../org/apache/spark/sql/execution/CollectMetricsExec.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/CollectMetricsExec.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/CollectMetricsExec.scala index 2115e21f81d71..0a487bac77696 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/CollectMetricsExec.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/CollectMetricsExec.scala @@ -67,7 +67,6 @@ case class CollectMetricsExec( override protected def doExecute(): RDD[InternalRow] = { val collector = accumulator - collector.reset() child.execute().mapPartitions { rows => // Only publish the value of the accumulator when the task has completed. This is done by // updating a task local accumulator ('updater') which will be merged with the actual