From 3b41af193c4c418ea54057297e77801adb7d757b Mon Sep 17 00:00:00 2001 From: yangchuan Date: Thu, 9 Nov 2023 17:03:52 +0800 Subject: [PATCH] fix --- .../src/main/scala/io/glutenproject/utils/Iterators.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gluten-core/src/main/scala/io/glutenproject/utils/Iterators.scala b/gluten-core/src/main/scala/io/glutenproject/utils/Iterators.scala index 5e370a42c616..916a0d2a7e9d 100644 --- a/gluten-core/src/main/scala/io/glutenproject/utils/Iterators.scala +++ b/gluten-core/src/main/scala/io/glutenproject/utils/Iterators.scala @@ -20,6 +20,7 @@ import org.apache.spark.{InterruptibleIterator, TaskContext} import org.apache.spark.sql.execution.metric.SQLMetric import org.apache.spark.util.TaskResources +import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.{AtomicBoolean, AtomicLong} private class PayloadCloser[A](in: Iterator[A])(closeCallback: A => Unit) extends Iterator[A] { @@ -110,8 +111,10 @@ private class PipelineTimeAccumulator[A](in: Iterator[A], pipelineTime: SQLMetri } private def tryFinish(): Unit = { - pipelineTime += accumulatedTime.getAndSet( - 0L + pipelineTime += TimeUnit.NANOSECONDS.toMillis( + accumulatedTime.getAndSet( + 0L + ) ) // make sure the accumulated time is submitted once } }