You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/08 14:18:18 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #35432: [SPARK-37585][SQL] Update InputMetric in DataSourceRDD with TaskCompletionListener

cloud-fan commented on a change in pull request #35432:
URL: https://github.com/apache/spark/pull/35432#discussion_r801678659



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceRDD.scala
##########
@@ -126,14 +127,9 @@ private class MetricsHandler extends Logging with Serializable {
 private abstract class MetricsIterator[I](iter: Iterator[I]) extends Iterator[I] {
   protected val metricsHandler = new MetricsHandler
 
-  override def hasNext: Boolean = {
-    if (iter.hasNext) {
-      true
-    } else {
-      metricsHandler.updateMetrics(0, force = true)
-      false
-    }
-  }
+  override def hasNext: Boolean = iter.hasNext

Review comment:
       Can we keep updating metrics at the end of the iterator? It's still useful in cases like `RDD.coalesce`, where a task consumes multiple iterators for coalesced partitions, and we can update metrics earlier here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org