incubator-hcatalog-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Potter <thelabd...@gmail.com>
Subject Re: Rookie question
Date Tue, 29 Jan 2013 03:18:31 GMT
Hi Prashant,

I would cook up a shell script that sets the correct vars. Here's an
outline of what needs to be done:

export PIG_HOME to point to your Pig home directory, eg. /usr/lib/pig
export HIVE_HOME to point to your Hive home directory, eg. /usr/lib/hive
export HCAT_THRIFT_ADDRESS - should be your thrift:// metastore address

Add the HCatalog and Hive JARS to the pig.additional.jars system
property, something like this should do it:

for jar in $PIG_HOME/*.jar; do
   PIG_JAR=$jar
done

if [ ! -e $PIG_JAR ]; then
    echo "Unable to locate Pig jar" >&2
    exit 1
fi

CLASSPATH=/etc/hadoop/conf:$CLASSPATH:$PIG_JAR

# HCatalog support
HCAT_JARS=$HIVE_HOME/share/hcatalog/hcatalog-0.4.0.jar:$HIVE_HOME/lib/hive-metastore-0.9.0-cdh4.1.1.jar:$HIVE_HOME/lib/hive-exec-0.9.0-cdh4.1.1.jar:$HIVE_HOME/lib/libfb303-0.7.0.jar:$HIVE_HOME/lib/jdo2-api-2.3-ec.jar:$HIVE_HOME/conf:$HIVE_HOME/lib/slf4j-api-1.6.1.jar

CONTRIB_JARS=$CONTRIB_JARS:$HCAT_JARS

export PIG_CLASSPATH=$PIG_CLASSPATH:$CLASSPATH
export PIG_OPTS="$PIG_OPTS -Dhive.metastore.uris=$HCAT_THRIFT_ADDRESS
-Dpig.additional.jars=$CONTRIB_JARS"
$PIG_HOME/bin/pig $*

Let me know if that works for you.


On Mon, Jan 28, 2013 at 7:21 PM, Prashant Kommireddi
<prash1784@gmail.com> wrote:
> Hi,
>
> I just started looking at Hcat code and had a question - how do you run a
> Pig job via command line in HCatalog? I am looking at TempletonControllerJob
> and am wondering what the args or command looks like for this Map job.
>
> Thanks,
> Prashant

Mime
View raw message