leanken opened a new pull request #29431: URL: https://github.com/apache/spark/pull/29431
### What changes were proposed in this pull request? Found java.util.NoSuchElementException in UT log of AdaptiveQueryExecSuite. During AQE, when sub-plan changed, LiveExecutionData is using the new sub-plan SQLMetrics to override the old ones, But in the final aggregateMetrics, it will cause NoSuchElementException, so it should be a upsert for SQLMetrics when it comes to a new sub-plan. ### Why are the changes needed? SQL Metrics is not correct for some AQE cases. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Run AdaptiveQueryExecSuite with no "java.util.NoSuchElementException". ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org