-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-13180] Protect against SessionState being null when accessing HiveClientImpl#conf #11066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #50703 has finished for PR 11066 at commit
|
|
|
||
| /** Returns the configuration for the current session. */ | ||
| def conf: HiveConf = SessionState.get().getConf | ||
| def conf: HiveConf = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an exact copy of https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala#L171-L182.
Can you refactor this?
|
The method in HiveQl is marked private[this]. HiveShim.scala and SparkSQLCLIDriver.scala refer to SessionState but they don't seem to be suitable place to put the common code. Do you have suggestion on which class to put the common code in ? Thanks |
|
@tedyu lets create a |
|
Test build #50749 has finished for PR 11066 at commit
|
|
Test build #50750 has finished for PR 11066 at commit
|
|
Test build #50751 has finished for PR 11066 at commit
|
|
Test build #50754 has finished for PR 11066 at commit
|
|
This error surfaced: |
|
I wonder if rev 1 should be used: the utility class only saves less than 10 lines of code |
|
@hvanhovell |
|
Test build #50827 has finished for PR 11066 at commit
|
|
@davies |
|
@tedyu This seems like a workaround. Have you find the root cause? Maybe there is a place that we didn't set the SessionState for current thread. |
|
From HiveContext.scala , line 552 (the last line below) which appeared in the stack trace: If I read the doc correctly, the above call is supposed to create new SessionState which is what the PR is doing. |
|
The doc is out-updated, HiveConf is created in HiveClientImp.scla LINE 107 (when created HiveClientImp obj). |
|
The user was using 1.6.0 where there was no HiveClientImp.scala |
|
Thanks for the pull request. I'm going through a list of pull requests to cut them down since the sheer number is breaking some of the tooling we have. Due to lack of activity on this pull request, I'm going to push a commit to close it. Feel free to reopen it or create a new one. We can also continue the discussion on the JIRA ticket. Note: Looks like this code path has been rewritten heavily and the problem might not apply anymore. |
See http://search-hadoop.com/m/q3RTtFoTDi2HVCrM1 for related stack trace