gaogaotiantian commented on code in PR #54291:
URL: https://github.com/apache/spark/pull/54291#discussion_r2818645799
##########
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:
Do we still need changes here? If we consider local property thread safe,
the original code should be fine right? I don't want to add redundant logic for
multi thread safety. This will mislead others (and ourselves in the future)
that `setLocalProperty` is not thread safe. We should consider it to be thread
safe, write code like it is, and fix all the issues behind it which made it
unsafe.
If it's really not thread safe, this code probably still has some racing
issues.
--
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]