izchen commented on a change in pull request #3863:
URL: https://github.com/apache/iceberg/pull/3863#discussion_r781813118
##########
File path:
spark/v3.0/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DynamicFileFilterExec.scala
##########
@@ -78,6 +85,16 @@ abstract class DynamicFileFilterExecBase(
override def simpleString(maxFields: Int): String = {
s"DynamicFileFilterExec${truncatedString(output, "[", ", ", "]",
maxFields)}"
}
+
+ def postFileFilterMetric(totalFilesNumber: Int, hitFilesNumber: Int): Unit =
{
+ longMetric("totalFiles").set(totalFilesNumber)
+ longMetric("hitFiles").set(hitFilesNumber)
+ if (totalFilesNumber > 0) {
+ longMetric("fileHitRate").set(hitFilesNumber * 100 / totalFilesNumber)
+ }
+ val executionId =
sparkContext.getLocalProperty(SQLExecution.EXECUTION_ID_KEY)
+ SQLMetrics.postDriverMetricUpdates(sparkContext, executionId,
metrics.values.toSeq)
Review comment:
> Updates metrics based on the driver side value. This is useful for
certain metrics that are only updated on the driver, e.g. subquery execution
time, or number of files.
The metrics of BroadcastExchangeExec are updated in this way:
https://github.com/apache/spark/blob/3d2fde5242c8989688c176b8ed5eb0bff5e1f17f/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/BroadcastExchangeExec.scala#L169-L174
--
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]