comphead commented on code in PR #3842:
URL: https://github.com/apache/datafusion-comet/pull/3842#discussion_r3012541080
##########
spark/src/main/scala/org/apache/spark/sql/comet/CometExecRDD.scala:
##########
@@ -139,6 +139,18 @@ private[spark] class CometExecRDD(
ctx.addTaskCompletionListener[Unit] { _ =>
it.close()
subqueries.foreach(sub => CometScalarSubquery.removeSubquery(it.id,
sub))
+
+ // Propagate native scan metrics (bytes_scanned, output_rows) to
Spark's task-level
+ // inputMetrics so they appear in the Spark UI "Input" column and are
reported via
+ // the listener infrastructure. The native reader bypasses Hadoop's
Java FileSystem,
+ // so thread-local FS statistics are never updated -- we bridge the
gap here.
+ val bytesScannedMetric = nativeMetrics.findMetric("bytes_scanned")
+ val outputRowsMetric = nativeMetrics.findMetric("output_rows")
+ if (bytesScannedMetric.isDefined || outputRowsMetric.isDefined) {
+ val inputMetrics = ctx.taskMetrics().inputMetrics
+ bytesScannedMetric.foreach(m => inputMetrics.setBytesRead(m.value))
Review Comment:
agree
--
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]