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 2013/04/07 08:58:57 UTC

svn commit: r1465329 - in /pig/trunk: CHANGES.txt bin/pig src/docs/src/documentation/content/xdocs/start.xml

Author: daijy
Date: Sun Apr  7 06:58:56 2013
New Revision: 1465329

URL: http://svn.apache.org/r1465329
Log:
PIG-3261: User set PIG_CLASSPATH entries must be prepended to the CLASSPATH, not appended

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/bin/pig
    pig/trunk/src/docs/src/documentation/content/xdocs/start.xml

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1465329&r1=1465328&r2=1465329&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sun Apr  7 06:58:56 2013
@@ -28,6 +28,9 @@ PIG-3174:  Remove rpm and deb artifacts 
 
 IMPROVEMENTS
 
+PIG-3261: User set PIG_CLASSPATH entries must be prepended to the CLASSPATH, not 
+appended (qwertymaniac via daijy)
+
 PIG-3141: Giving CSVExcelStorage an option to handle header rows (jpacker via cheolsoo)
 
 PIG-3217: Add support for DateTime type in Groovy UDFs (herberts via daijy)

Modified: pig/trunk/bin/pig
URL: http://svn.apache.org/viewvc/pig/trunk/bin/pig?rev=1465329&r1=1465328&r2=1465329&view=diff
==============================================================================
--- pig/trunk/bin/pig (original)
+++ pig/trunk/bin/pig Sun Apr  7 06:58:56 2013
@@ -25,6 +25,11 @@
 #
 #     PIG_CLASSPATH Extra Java CLASSPATH entries.
 #
+#     PIG_USER_CLASSPATH_FIRST If set, add user provided classpath entries to
+#                              the top of classpath instead of appending them.
+#                              Default is unset, i.e. the classpath entries are
+#                              placed normally at the end of a pre-defined classpath.
+#
 #     HADOOP_HOME/HADOOP_PREFIX     Environment HADOOP_HOME/HADOOP_PREFIX(0.20.205)
 #
 #     HADOOP_CONF_DIR     Hadoop conf dir
@@ -184,11 +189,16 @@ if [ "$includeHCatalog" == "true" ]; the
   CLASSPATH=${CLASSPATH}:$ADDITIONAL_CLASSPATHS:$HIVE_HOME/conf
 fi
 
-# add user-specified CLASSPATH
+# Add user-specified CLASSPATH entries via PIG_CLASSPATH
+# If PIG_USER_CLASSPATH_FIRST is set, prepend the entries
 if [ "$PIG_CLASSPATH" != "" ]; then
+  if [ "$PIG_USER_CLASSPATH_FIRST" == "" ]; then
     CLASSPATH=${CLASSPATH}:${PIG_CLASSPATH}
+  else
+    CLASSPATH=${PIG_CLASSPATH}:${CLASSPATH}
+  fi
 fi
- 
+
 # add HADOOP_CONF_DIR
 if [ "$HADOOP_CONF_DIR" != "" ]; then
     CLASSPATH=${CLASSPATH}:${HADOOP_CONF_DIR}

Modified: pig/trunk/src/docs/src/documentation/content/xdocs/start.xml
URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/start.xml?rev=1465329&r1=1465328&r2=1465329&view=diff
==============================================================================
--- pig/trunk/src/docs/src/documentation/content/xdocs/start.xml (original)
+++ pig/trunk/src/docs/src/documentation/content/xdocs/start.xml Sun Apr  7 06:58:56 2013
@@ -530,7 +530,8 @@ $ hadoop fs –copyFromLocal excite.l
 <li>Set the PIG_CLASSPATH environment variable to the location of the cluster configuration directory (the directory that contains the core-site.xml, hdfs-site.xml and mapred-site.xml files):
 <source>
 export PIG_CLASSPATH=/mycluster/conf
-</source></li>
+</source>
+<p><strong>Note:</strong> The PIG_CLASSPATH can also be used to add any other 3rd party dependencies or resource files a pig script may require. If there is also a need to make the added entries take the highest precedence in the Pig JVM's classpath order, one may also set the env-var PIG_USER_CLASSPATH_FIRST to any value, such as 'true' (and unset the env-var to disable).</p></li>
 <li>Set the HADOOP_CONF_DIR environment variable to the location of the cluster configuration directory:
 <source>
 export HADOOP_CONF_DIR=/mycluster/conf