diff --git a/bin/ext/hiveserver2.cmd b/bin/ext/hiveserver2.cmd
index a5f3bb5..dc3bba3 100644
--- a/bin/ext/hiveserver2.cmd
+++ b/bin/ext/hiveserver2.cmd
@@ -59,8 +59,6 @@ if [%1]==[hiveserver2_help] goto :hiveserver2_help
if [%1]==[hiveserver2_catservice] goto :hiveserver2_catservice
-if [%1]==[hiveserver2_catcmd] goto :hiveserver2_catcmd
-
:hiveserver2
echo "Starting Hive Thrift Server"
@@ -78,21 +76,11 @@ goto :EOF
@echo ^HiveServer2^
@echo ^HiveServer2^
@echo ^Hadoop HiveServer2 Service^
-@echo ^%SystemRoot%\system32\cmd.exe^
-@echo ^/c %HIVE_BIN_PATH%\ext\hs2service.cmd ^
+@echo ^%JAVA_HOME%\bin\java^
+@echo ^%JAVA_HEAP_MAX% %HADOOP_OPTS% -classpath %CLASSPATH%;%HIVE_HBASE_PATH% %CLASS% -hiveconf hive.hadoop.classpath=%HIVE_LIB%\* -hiveconf hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory -hiveconf hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator -hiveconf hive.metastore.uris=" " %HIVE_OPTS%^
@echo ^
goto :EOF
-
-:hiveserver2_catcmd
-if not defined HADOOP_CLASSPATH (
- @echo set HADOOP_CLASSPATH=%HIVE_LIB%\*
- ) else (
- @echo set HADOOP_CLASSPATH=%HADOOP_CLASSPATH%;%HIVE_LIB%\*
- )
-@echo %JAVA_HOME%\bin\java %JAVA_HEAP_MAX% %HADOOP_OPTS% -classpath %CLASSPATH%;%HIVE_HBASE_PATH% %CLASS% -hiveconf hive.metastore.uris=" " -hiveconf hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory -hiveconf hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator %HIVE_OPTS%
-goto :EOF
-
:AddToHiveHbasePath
if not defined HIVE_HBASE_PATH (
set HIVE_HBASE_PATH=%1
diff --git a/bin/hive.cmd b/bin/hive.cmd
index c2e9853..ba7e443 100644
--- a/bin/hive.cmd
+++ b/bin/hive.cmd
@@ -284,9 +284,6 @@ if defined CATSERVICE (
) else (
call %HADOOP_HOME%\libexec\hadoop-config.cmd
)
- if %TORUN% == hiveserver2 (
- call %HIVE_BIN_PATH%\ext\hiveserver2.cmd hiveserver2_catcmd > %HIVE_BIN_PATH%\ext\hs2service.cmd
- )
call %HIVE_BIN_PATH%\ext\%TORUN%.cmd %TORUN%%CATSERVICE% %*
goto :EOF
)
diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index 3fe67b2..03d60e6 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -1721,8 +1721,10 @@
HIVE_VECTORIZATION_GROUPBY_FLUSH_PERCENT("hive.vectorized.groupby.flush.percent", (float) 0.1,
"Percent of entries in the group by aggregation hash flushed when the memory threshold is exceeded."),
-
HIVE_TYPE_CHECK_ON_INSERT("hive.typecheck.on.insert", true, ""),
+ HIVE_HADOOP_CLASSPATH("hive.hadoop.classpath", null,
+ "For Windows OS, we need to pass HIVE_HADOOP_CLASSPATH Java parameter while starting HiveServer2 \n" +
+ "using \"-hiveconf hive.hadoop.classpath=%HIVE_LIB%\"."),
HIVE_RPC_QUERY_PLAN("hive.rpc.query.plan", false,
"Whether to send the query plan via local resource or RPC"),
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java
index 79da5a0..0676312 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/MapredLocalTask.java
@@ -238,6 +238,18 @@ public int executeInChildVM(DriverContext driverContext) {
variables.put(HADOOP_OPTS_KEY, hadoopOpts);
}
+ //For Windows OS, we need to pass HIVE_HADOOP_CLASSPATH Java parameter while starting
+ //Hiveserver2 using "-hiveconf hive.hadoop.classpath=%HIVE_LIB%". This is to combine path(s).
+ if (HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_HADOOP_CLASSPATH)!= null)
+ {
+ if (variables.containsKey("HADOOP_CLASSPATH"))
+ {
+ variables.put("HADOOP_CLASSPATH", variables.get("HADOOP_CLASSPATH") + ";" + HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_HADOOP_CLASSPATH));
+ } else {
+ variables.put("HADOOP_CLASSPATH", HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_HADOOP_CLASSPATH));
+ }
+ }
+
if(variables.containsKey(MapRedTask.HIVE_DEBUG_RECURSIVE)) {
MapRedTask.configureDebugVariablesForChildJVM(variables);
}