-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-7331][SQL] Re-use HiveConf in HiveQl #5880
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
|
ok to test |
|
Test build #32027 has finished for PR 5880 at commit
|
|
Probably it's better to get the |
|
Using that when |
|
Closing this PR over master as it has been fixed as part of SPARK-7411. Will create separate PRs for 1.2 and 1.3 branch |
|
@chenghao-intel @marmbrus (as per my understanding) Looks like SessionState is threadlocal and gets SET only for "NativeCommands" which gets executed on hive. For Spark SQL commands, its not set and each time creates a new hive conf for Spark SQL queries and defeating the actual purpose of this issue. |
|
|
|
@chenghao-intel I get that. So, should we do something like :- lazy val cachedHiveConf = new HiveConf() private[this] def hiveConf(): HiveConf = { |
|
Oh, thanks for noticing this. But the answer is not necessary! The reason that I put the Sorry, I should put more comment here. |
|
Sorry for not being clear in my first comment but I meant that for queries like "select a,b,c from table where a=10" where table is cached as schemaRDD (spark-1.2), SessionState.get() is always returning null. Do you see why this might be happening? |
|
In Spark 1.2, the SessionState should be initialized in HiveContext (or probably in SparkSQLCLIDriver if you are using the CLI). Can you describe how to reproduce that? Or are you using the HiveContext, not SQLContext? |
|
Yes, I am using HiveContext and calling hiveContext.sql, basically following line gets executed :- If this problem seems to be just with 1.2, can we make the change as I suggested in 1.2 branch? |
|
Hmm, seems a bug in Spark 1.2, will cause some performance overhead (creating the HiveConf object everytime), but, we should always initialize the
|
|
Yes, seems like it is being done in 1.4 Should we do exactly like this in 1.2 as well? |
|
Actually the HiveContext changed a lot since 1.2, it will be great if you can figure out a simple / nature way to fix this. In general, we just need to trigger the initialization of the |
Re-use HiveConf in HiveQl