danny0405 commented on code in PR #18882:
URL: https://github.com/apache/hudi/pull/18882#discussion_r3332943858


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieMergeOnReadRDDV2.scala:
##########
@@ -259,6 +255,34 @@ class HoodieMergeOnReadRDDV2(@transient sc: SparkContext,
     }
   }
 
+  private def withInputMetrics(iter: Iterator[InternalRow],
+                               closeableIter: Iterator[InternalRow],
+                               context: TaskContext,
+                               bytesReadCallback: () => Long): 
Iterator[InternalRow] = {
+    val metricIter = new Iterator[InternalRow] with Closeable {
+      override def hasNext: Boolean = iter.hasNext
+
+      override def next(): InternalRow = {
+        val row = iter.next()
+        HoodieSparkInputMetricsUtils.incRecordsRead(context, 1)
+        row
+      }
+
+      override def close(): Unit = {

Review Comment:
   will spark close this wrapper iterator automatically?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to