You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "karuppayya (via GitHub)" <gi...@apache.org> on 2023/02/25 15:03:35 UTC

[GitHub] [iceberg] karuppayya commented on a diff in pull request #6919: Add HasScan metrics interface

karuppayya commented on code in PR #6919:
URL: https://github.com/apache/iceberg/pull/6919#discussion_r1117935050


##########
core/src/main/java/org/apache/iceberg/SnapshotScan.java:
##########
@@ -66,7 +66,8 @@ protected Long snapshotId() {
 
   protected abstract CloseableIterable<T> doPlanFiles();
 
-  protected ScanMetrics scanMetrics() {
+  @Override
+  public ScanMetrics scanMetrics() {

Review Comment:
    The metrics need to be accessible in the SparkPartitionAwareScan (to be populated in [customDriverMetrics](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/java/org/apache/spark/sql/connector/read/Scan.java#L126)),
   When control flows to the SparkPartitionAwareScan, the BaseTable(where MetricsReporter is associated with table) is already created.
   Hence I am getting this from the SnapshotScan.
   I will change it to use the ScanReport.
   



##########
api/src/main/java/org/apache/iceberg/BatchScanAdapter.java:
##########
@@ -140,4 +140,8 @@ public int splitLookback() {
   public long splitOpenFileCost() {
     return scan.splitOpenFileCost();
   }
+
+  public Scan getScanDelegate() {

Review Comment:
   SnapShotScan has the relevant read metrics. Exposing the backing scan object from the adapter to extract the metrics. (which will be used [here](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/java/org/apache/spark/sql/connector/read/Scan.java#L126))



-- 
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: issues-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org