peter-toth opened a new pull request, #54396: URL: https://github.com/apache/spark/pull/54396
### What changes were proposed in this pull request? This PR adds reverts [SPARK-52809](https://issues.apache.org/jira/browse/SPARK-52809) / https://github.com/apache/spark/pull/51503 and offers a new way to track most recently created reader and do a final metrics update in a task completion listener. The changes are required as `DataSourceRDD.compute()` can be called multiple times in thead/task when the `DataSourceRDD` gets coalesced. Please find an example in the new test. ### Why are the changes needed? To calculate custom metrics correctly. ### Does this PR introduce _any_ user-facing change? It fixes metrics calculation. ### How was this patch tested? New UT is added. ### Was this patch authored or co-authored using generative AI tooling? No. -- 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]
