gerashegalov commented on code in PR #18775:
URL: https://github.com/apache/iceberg/pull/18775#discussion_r4776619009


##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/source/BatchDataReader.java:
##########
@@ -91,9 +93,15 @@ class BatchDataReader extends BaseBatchReader<FileScanTask>
 
   @Override
   public CustomTaskMetric[] currentMetricsValues() {
-    return new CustomTaskMetric[] {
-      new TaskNumSplits(numSplits), new TaskNumDeletes(counter().get())
-    };
+    return inheritedMetrics.addTo(
+        new TaskNumSplits(numSplits),
+        new TaskNumDeletes(counter().get()),
+        new TaskScanDuration(scanDurationNanos()));

Review Comment:
   Thanks! Confirmed locally: moving `TaskScanDuration` out of `addTo` fails 
the matching test for each reader, and the drain check catches `+=` turning 
into `=`.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to