-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-11000][YARN]Load metadata.Hive
class only when hive.metastore.uris
was set to avoid bootting the database twice
#9026
Conversation
…arn security mode.
Test build #43390 has finished for PR 9026 at commit
|
/cc @marmbrus @liancheng |
LGTM. |
This looks reasonable but as in SPARK-9776 should there ever be two HiveContexts open, or is this triggered without that? is it a problem that there are two database instances then? that is, the problem seems legitimate if the metastore DB has already been initialized but something else is doing it again. |
@srowen In this issue there is only one |
Makes sense. Is it a problem that we actually have two metastores? Maybe not. That's my only question, looking at this from the outside. |
Actually there are two metastores. In hive-1.2.1 when we use |
OK I confess I don't know this aspect well but I think you explained how this is different from just accidentally making two HiveContexts here. To my knowledge it sounds reasonable. |
"org.datanucleus.store.rdbms.adapter.DerbyAdapter") | ||
|
||
val hiveClass = mirror.classLoader.loadClass("org.apache.hadoop.hive.ql.metadata.Hive") | ||
val hive = hiveClass.getMethod("get").invoke(null, hiveConf.asInstanceOf[Object]) |
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.
So, the original problem is caused by this line, right?
Since the hive
object is only used inside the condition on L1301, can't you move the original line inside that if
and fix the problem? You don't need delegation tokens when using Derby (and hive.metastore.uris
would be empty in that case), so there's no point in even trying to call this class if Derby is being used.
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.
Good idea
Test build #43830 has finished for PR 9026 at commit
|
Much better. :-) LGTM |
ah, btw, can you fix the pr description to reflect the actual change? thanks! |
metadata.Hive
class only when hive.metastore.uris
was set to avoid bootting the database twice
@vanzin, looks like the description has now been updated, so this should be ready for another look I think. |
The description still mentions the old approach, just the title was changed. I can delete the description while merging though. |
obtainTokenForHiveMetastore in yarn.Client.scala will init the
Hive
.It will create a connect to the database and the meta store client in
HiveContext
will also create a connect to the database. If use the derby by default, it will go wrong.So I specilized the configuration of the
javax.jdo.option.ConnectionURL
in theobtainTokenForHiveMetastore
to avoid this issue./cc @KaiXinXiaoLei