Uh oh!
There was an error while loading. Please reload this page.
[SPARK-30556][SQL][FOLLOWUP] Reset the status changed in SQLExecution.withThreadLocalCaptured - #27516
[SPARK-30556][SQL][FOLLOWUP] Reset the status changed in SQLExecution.withThreadLocalCaptured#27516xuanyuanking wants to merge 3 commits into
Conversation
210b195 to
0128a37Comparexuanyuanking
commented
Feb 10, 2020
Uh oh!
There was an error while loading. Please reload this page.
| val localProps = Utils.cloneProperties(sc.getLocalProperties) | ||
| Future { | ||
| val originalContext = SparkSession.getActiveSession | ||
| val originalLocalProps = Utils.cloneProperties(sc.getLocalProperties) |
There was a problem hiding this comment.
We can assure the LocalProps is used in current thread here, getLocalProperties is enough, done in a33154c, thanks.
There was a problem hiding this comment.
I think clone is required. Please read
#27267 (comment)
Also i dont see why we need to reset. By default pool threads do not have any localproperties or localsession variable set. That means after the thread is used for first time, this change will always try to retain those properties and session by always finally resetting it to same, which is kind of stale already. Right.?
There was a problem hiding this comment.
I think clone is required.
The two scenarios are different, the first one needs clone since we want a snapshot of local properties during submit. But for this one, we need to reset by the variable self. If use clone here, changes in other places might be dropped.
Also i dont see why we need to reset.
For the function added in SQLExecution here, I think we need to clean up all the side effects as far as possible, even though it works in this case.
SparkQA
commented
Feb 10, 2020
Test build #118115 has finished for PR 27516 at commit
|
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Feb 10, 2020
Test build #118119 has finished for PR 27516 at commit
|
| // set local configuration and assert | ||
| val confValue1 = "e" | ||
| val confValue1 = UUID.randomUUID().toString() |
There was a problem hiding this comment.
I don't think this is particularly needed. The value here doesn't matter at all. It doesn't test if the given value itself was correct or not. It just tests if the value is set or not. But .. I am okay.
SparkQA
commented
Feb 10, 2020
Test build #118142 has finished for PR 27516 at commit
|
cloud-fan
commented
Feb 10, 2020
retest this please |
SparkQA
commented
Feb 10, 2020
Test build #118160 has finished for PR 27516 at commit
|
hvanhovell
left a comment
There was a problem hiding this comment.
LGTM - thanks for addressing this!
hvanhovell
commented
Feb 10, 2020
Merging in master/3.0. |
….withThreadLocalCaptured ### What changes were proposed in this pull request? Follow up for #27267, reset the status changed in SQLExecution.withThreadLocalCaptured. ### Why are the changes needed? For code safety. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Existing UT. Closes#27516 from xuanyuanking/SPARK-30556-follow. Authored-by: Yuanjian Li <xyliyuanjian@gmail.com> Signed-off-by: herman <herman@databricks.com> (cherry picked from commit a6b91d2) Signed-off-by: herman <herman@databricks.com>
xuanyuanking
commented
Feb 11, 2020
Thanks all for review. |
gatorsmile
commented
Feb 19, 2020
The original PR #27340 was merged to 2.4 too. Should we fix 2.4? |
xuanyuanking
commented
Feb 19, 2020
Copy, will send a backport. |
….withThreadLocalCaptured Follow up for apache#27267, reset the status changed in SQLExecution.withThreadLocalCaptured. For code safety. No. Existing UT. Closesapache#27516 from xuanyuanking/SPARK-30556-follow. (cherry picked from commit a6b91d2)
….withThreadLocalCaptured ### What changes were proposed in this pull request? Follow up for apache#27267, reset the status changed in SQLExecution.withThreadLocalCaptured. ### Why are the changes needed? For code safety. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Existing UT. Closesapache#27516 from xuanyuanking/SPARK-30556-follow. Authored-by: Yuanjian Li <xyliyuanjian@gmail.com> Signed-off-by: herman <herman@databricks.com>
What changes were proposed in this pull request?
Follow up for #27267, reset the status changed in SQLExecution.withThreadLocalCaptured.
Why are the changes needed?
For code safety.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing UT.