--- bin/pig.orig 2014-11-17 04:37:53.000000000 +0300 +++ bin/pig 2015-02-15 16:23:44.000000000 +0300 @@ -88,6 +88,8 @@ export PIG_HOME=`dirname "$this"`/.. fi +PIG_CONF_DIR=${PIG_HOME}/etc/pig + if [ -z "$PIG_CONF_DIR" ]; then if [ -f ${PIG_HOME}/conf/pig.properties ]; then PIG_CONF_DIR=${PIG_HOME}/conf @@ -111,6 +113,7 @@ JAVA_HOME=$JAVA_HOME fi +JAVA_HOME=%%JAVA_HOME%% if [ "$JAVA_HOME" = "" ]; then echo "Error: JAVA_HOME is not set." exit 1 @@ -206,6 +209,7 @@ fi # add HADOOP_CONF_DIR +HADOOP_CONF_DIR=%%LOCALBASE%%/etc/hadoop if [ "$HADOOP_CONF_DIR" != "" ]; then CLASSPATH=${CLASSPATH}:${HADOOP_CONF_DIR} fi @@ -244,23 +248,23 @@ # For Hadoop 0.23.0+ # -#if [ -d "${PIG_HOME}/share/hadoop/common" ]; then -# for f in ${PIG_HOME}/share/hadoop/common/hadoop*.jar; do -# CLASSPATH=${CLASSPATH}:$f; -# done -#fi -# -#if [ -d "${PIG_HOME}/share/hadoop/hdfs" ]; then -# for f in ${PIG_HOME}/share/hadoop/hdfs/hadoop*.jar; do -# CLASSPATH=${CLASSPATH}:$f; -# done -#fi -# -#if [ -d "${PIG_HOME}/share/hadoop/mapreduce" ]; then -# for f in ${PIG_HOME}/share/hadoop/mapreduce/hadoop*.jar; do -# CLASSPATH=${CLASSPATH}:$f; -# done -#fi +if [ -d "${PIG_HOME}/share/hadoop/common" ]; then + for f in ${PIG_HOME}/share/hadoop/common/hadoop*.jar; do + CLASSPATH=${CLASSPATH}:$f; + done +fi + +if [ -d "${PIG_HOME}/share/hadoop/hdfs" ]; then + for f in ${PIG_HOME}/share/hadoop/hdfs/hadoop*.jar; do + CLASSPATH=${CLASSPATH}:$f; + done +fi + +if [ -d "${PIG_HOME}/share/hadoop/mapreduce" ]; then + for f in ${PIG_HOME}/share/hadoop/mapreduce/hadoop*.jar; do + CLASSPATH=${CLASSPATH}:$f; + done +fi if which hadoop >/dev/null; then HADOOP_BIN=`which hadoop`