Yicong-Huang commented on code in PR #54291:
URL: https://github.com/apache/spark/pull/54291#discussion_r2818710480
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala:
##########
@@ -108,11 +108,14 @@ object SQLExecution extends Logging {
// Track the "root" SQL Execution Id for nested/sub queries. The current
execution is the
// root execution if the root execution ID is null.
// And for the root execution, rootExecutionId == executionId.
- if (sc.getLocalProperty(EXECUTION_ROOT_ID_KEY) == null) {
+ val existingRootId = sc.getLocalProperty(EXECUTION_ROOT_ID_KEY)
Review Comment:
I believe that after adding the clone, it should be thread-safe, pending
confirmation from repeated CI runs.
That said, it’s still reasonable to be defensive here. The new code does not
assume thread safety; it simply reads the property once and writes it once,
which avoids redundant access and is cleaner overall.
--
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]