When running on the master node, these two ways of creating HiveConf can result in different Hive configurations:
the above one referred as Style1, and
the above one referred as Style2. If there are properties exist both in hiveSite and jobConf. For example, in hive-site.xml, we have property
And if at the same time in jobConf, such as action configurations in Oozie's workflow.xml, we have
Then in Style1, the "hive.metastore.uris" property in hiveConf is "AAA" and in Style2, the property in hiveConf is "BBB".
Here is another example to illustrate this. Suppose in hiveSite, "hive.metastore.uris" is AAA and in jobConf it is BBB, when executing the following code:
And the log output is:
In all, the jobConf does not got set to the configuration as expected when there's already such a property existed in hive site. This happen only on the master node but not on task nodes.