Wednesday, April 6, 2011

Hadoop: How to install and test PIG

like install and test Hive on hadoop cluster, Pig is another end-user facing analytical tools for Hadoop. unlike SQL style query for Hive, Pig use the scripting language which will be more familiar to Sys admins.

Download Pig From Yahoo, http://www.apache.org/dyn/closer.cgi/pig

Unzip the files and go the bin folder, only change is we need to add the hadoop conf folder to the class path. then pig knows how to deal with hadoop cluster,

# cygwin path translation
if $cygwin; then
    CLASSPATH=`cygpath -p -w "$CLASSPATH"`
    PIG_HOME=`cygpath -d "$PIG_HOME"`
    PIG_LOG_DIR=`cygpath -d "$PIG_LOG_DIR"`
fi

#add hadoop conf folder to the classpath

export CLASSPATH=$CLASSPATH:/usr/lib/hadoop/conf

After that, you can run the ./bin/pig to start the shell of Pig,

image

Here are the Pig syntax.
http://pig.apache.org/docs/r0.8.0/cookbook.html

2 comments:

Jarod said...

Hey, have you tried to run pig in local mode (pig -x local) under cygwin? My machine failed to start the grunt environment and threw a wired IOException...

kalai arasan said...

Hi

Can you please share the details how to configure Hive and PIG to run on windows using Cygwin?

I couldn’t find any helpful details / pointers that could help to run pig in cygwin.

Thanks
Kalai

 
Locations of visitors to this page