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

[GitHub] [iceberg] nastra commented on pull request #6919: Add HasScan metrics interface

nastra commented on PR #6919:
URL: https://github.com/apache/iceberg/pull/6919#issuecomment-1479659932

   > > I believe @karuppayya meant to report from here directly to Spark metrics. @karuppayya were you planning to add that functionality as part of this PR?
   > 
   > Yes, that was the idea.To access the metrics in SparkScanBuilder to use [here](https://github.com/apache/spark/commit/d4c58159925133771d305cc7ac4f1248f215812c)
   
   Ok I thought that the `SparkMetricsReporter` would have some custom code to report to Spark directly, but if that's not required, then I don't think we need that class. In that case you could just have a lambda similar to https://github.com/apache/iceberg/blob/e340ad5be04e902398c576f431810c3dfa4fe717/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java#L361
   
   Something like 
   ```
   private void reportMetricsToSpark(MetricsReport report) {
       // report to spark
     }
   ```
   ```
   BatchScan scan =
           table
               .newBatchScan()
               .caseSensitive(caseSensitive)
               .filter(filterExpression())
               .project(expectedSchema)
               .withMetricsReporter(this::reportMetricsToSpark);
   ```


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