diff --git a/bin/pig.cmd b/bin/pig.cmd index e930fa9..b8c1148 100644 --- a/bin/pig.cmd +++ b/bin/pig.cmd @@ -58,11 +58,18 @@ set PIGARGS= ) goto :ProcessCmdLine ) + REM Account for quotes around %1 if needed when checking for -useHCatalog + REM because the string may come in quoted from WebHCat. if %1==-useHCatalog ( shift set HCAT_FLAG="true" goto :ProcessCmdLine ) + if %1==^"-useHCatalog^" ( + shift + set HCAT_FLAG="true" + goto :ProcessCmdLine + ) set PIGARGS=%PIGARGS% %1 shift goto :ProcessCmdLine @@ -95,6 +102,17 @@ set PIGARGS= if not defined HCAT_FLAG ( goto HCAT_END ) + + REM Try to set HCAT_HOME if not set. Use of HCATALOG_HOME is deprecated. + REM Future development should use HCAT_HOME for consistency with non-Windows + REM environments. + if not defined HCAT_HOME ( + if defined HCATALOG_HOME ( + set HCAT_HOME=%HCATALOG_HOME% + ) else ( + echo "Warning: HCAT_HOME not set" + ) + ) if defined HCAT_HOME ( call :AddJar %HCAT_HOME%\share\hcatalog *hcatalog-*.jar @@ -111,6 +129,16 @@ set PIGARGS= call :AddJar %HIVE_HOME%\lib slf4j-api-*.jar call :AddJar %HIVE_HOME%\lib hive-hbase-handler-*.jar call :AddJar %HIVE_HOME%\lib httpclient-*.jar + + REM Include datanucleus to support embedded metastore use case via setting + REM hive.metastore.uris to '' + call :AddJar %HIVE_HOME%\lib datanucleus-*.jar + + REM Include sqljdbc4.jar to support SQL server or Windows Azure SQLDB as embedded metastore. + call :AddJar %HIVE_HOME%\lib sqljdbc4.jar + + REM Include derby to support local metastore as embedded metastore. + call :AddJar %HIVE_HOME%\lib derby*.jar ) else ( echo "HIVE_HOME should be defined" exit /b 1