Repository: hive Updated Branches: refs/heads/branch-1.2 2b340b0f9 -> de3ee7c40
HIVE-10968 : Windows: analyze json table via beeline failed throwing Class org.apache.hive.hcatalog.data.JsonSerDe not found (Hari Subramaniyan via Sushanth Sowmyan) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/de3ee7c4 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/de3ee7c4 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/de3ee7c4 Branch: refs/heads/branch-1.2 Commit: de3ee7c40b2b25df4420a12f200170108d7e3d5f Parents: 2b340b0 Author: Sushanth Sowmyan <khorg...@gmail.com> Authored: Sat Jun 13 19:12:56 2015 -0700 Committer: Sushanth Sowmyan <khorg...@gmail.com> Committed: Sat Jun 13 19:14:00 2015 -0700 ---------------------------------------------------------------------- bin/ext/hiveserver2.cmd | 51 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/de3ee7c4/bin/ext/hiveserver2.cmd ---------------------------------------------------------------------- diff --git a/bin/ext/hiveserver2.cmd b/bin/ext/hiveserver2.cmd index 5431de6..26c954c 100644 --- a/bin/ext/hiveserver2.cmd +++ b/bin/ext/hiveserver2.cmd @@ -55,6 +55,46 @@ if defined HBASE_HOME ( ) ) +@rem add auxilary jars such as serdes +if not defined HIVE_AUX_JARS_PATH goto :AddMiscAuxLibDir + +setLocal EnableDelayedExpansion +:auxJarLoop + for /f "delims=," %%a in ("!HIVE_AUX_JARS_PATH!") do ( + set auxjar=%%a + if exist %%a ( + if exist "%%a\nul" ( + @rem %%a is a dir + pushd %%a + for /f %%b IN ('dir /b *.jar') do ( + call :AddToAuxJavaParam %%a\%%b + ) + popd + ) else ( + @rem %%a is a file + call :AddToAuxJavaParam %%a + ) + ) + ) + :striploop + set stripchar=!HIVE_AUX_JARS_PATH:~0,1! + set HIVE_AUX_JARS_PATH=!HIVE_AUX_JARS_PATH:~1! + if "!HIVE_AUX_JARS_PATH!" EQU "" goto auxJarLoopEnd + if "!stripchar!" NEQ "," goto striploop + goto auxJarLoop + +:auxJarLoopEnd + +:AddMiscAuxLibDir +@rem adding jars from hcatalog\share\hcatalog directory +if exist %HIVE_HOME%\hcatalog\share\hcatalog ( + pushd %HIVE_HOME%\hcatalog\share\hcatalog + for /f %%a IN ('dir /b *.jar') do ( + call :AddToAuxJavaParam %HIVE_HOME%\hcatalog\share\hcatalog\%%a + ) + popd +) + if [%1]==[hiveserver2_help] goto :hiveserver2_help if [%1]==[hiveserver2_catservice] goto :hiveserver2_catservice @@ -76,7 +116,7 @@ goto :EOF @echo ^<name^>HiveServer2^</name^> @echo ^<description^>Hadoop HiveServer2 Service^</description^> @echo ^<executable^>%JAVA_HOME%\bin\java^</executable^> -@echo ^<arguments^>%JAVA_HEAP_MAX% -XX:MaxPermSize=512m %HADOOP_OPTS% -classpath %CLASSPATH%;%HIVE_HBASE_PATH%;%HIVE_HOME%\hcatalog\share\hcatalog\* %CLASS% -hiveconf hive.hadoop.classpath=%HIVE_LIB%\*;%HIVE_HOME%\hcatalog\share\hcatalog\* -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%^</arguments^> +@echo ^<arguments^>%JAVA_HEAP_MAX% -XX:MaxPermSize=512m %HADOOP_OPTS% -classpath %CLASSPATH%;%HIVE_HBASE_PATH%;%HIVE_HOME%\hcatalog\share\hcatalog\* %CLASS% -hiveconf hive.hadoop.classpath=%HIVE_LIB%\*;%HIVE_HOME%\hcatalog\share\hcatalog\* -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=" " -hiveconf hive.aux.jars.path=%AUX_JAVA_PARAM% %HIVE_OPTS%^</arguments^> @echo ^</service^> goto :EOF @@ -88,3 +128,12 @@ if not defined HIVE_HBASE_PATH ( ) ) goto :EOF + +:AddToAuxJavaParam +if not defined AUX_JAVA_PARAM ( + set AUX_JAVA_PARAM=file:///%1 + ) else ( + set AUX_JAVA_PARAM=%AUX_JAVA_PARAM%,file:///%1 + ) +) +goto :EOF \ No newline at end of file