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,

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"`

#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,


Here are the Pig syntax.


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...

Unknown said...


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.


Unknown said...

Is it possible to setup pig on a hadoop cluster running on windows without cygwin?

Locations of visitors to this page