You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2014/03/25 01:23:27 UTC

svn commit: r1581156 - in /pig/trunk: CHANGES.txt bin/pig.cmd

Author: daijy
Date: Tue Mar 25 00:23:26 2014
New Revision: 1581156

URL: http://svn.apache.org/r1581156
Log:
PIG-3794: pig -useHCatalog fails using pig command line interface on HDInsight

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/bin/pig.cmd

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1581156&r1=1581155&r2=1581156&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Tue Mar 25 00:23:26 2014
@@ -99,6 +99,8 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-3794: pig -useHCatalog fails using pig command line interface on HDInsight (ehans via daijy)
+
 PIG-3807: Pig creates wrong schema after dereferencing nested tuple fields with sorts (daijy)
 
 PIG-3813: Rank column is assigned different uids everytime when schema is reset (cheolsoo)

Modified: pig/trunk/bin/pig.cmd
URL: http://svn.apache.org/viewvc/pig/trunk/bin/pig.cmd?rev=1581156&r1=1581155&r2=1581156&view=diff
==============================================================================
--- pig/trunk/bin/pig.cmd (original)
+++ pig/trunk/bin/pig.cmd Tue Mar 25 00:23:26 2014
@@ -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