You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Jie Jin <he...@gmail.com> on 2013/11/16 12:40:13 UTC
How to run CliDriver with specify site configuration file hive-site.xml
Hi, All
How to run CliDriver with specific site configuration file?
I can run CliDriver this way: mvn exec:java
-Dexec.mainClass=org.apache.hadoop.hive.cli.CliDriver
But, It will pick up an empty hive-site.xml
How to specify another hive-site.xml , so hive can connect to a hadoop on
another machine.
In HiveConf, It will load hive-site.xml which located in classpath. ehhhh,
how to setup classpath when run the main class using mvn exec:java
Or is there another way to run hive cli?
static {
ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
classLoader = HiveConf.class.getClassLoader();
}
hiveDefaultURL = classLoader.getResource("hive-default.xml");
// Look for hive-site.xml on the CLASSPATH and log its location if
found.
hiveSiteURL = classLoader.getResource("hive-site.xml");
for (ConfVars confVar : ConfVars.values()) {
vars.put(confVar.varname, confVar);
}
}
Best Regards
金杰 (Jie Jin)