Pig in grunt mode Pig in grunt mode hadoop hadoop

Pig in grunt mode


The behavior is consistent with what you are observing. I will take the pig tutorial for example.

The following command does not result in any activity by pig.

raw = LOAD 'excite.log' USING PigStorage('\t') AS (user, time, query);

But if you invoke a command that results in using data from variable raw using some map-reduce thats when you will see some action in your grunt shell. Some thing along the lines of second command that is mentioned there.

clean1 = FILTER raw BY org.apache.pig.tutorial.NonURLDetector(query);

Similarly, your command will not result in any action, you have to use the data from variable A which results in map-reduce command to see some action on grunt shell:

grunt> A = load 'passwd' using PigStorage(':'); 


Pig will only process the commands when you use a command that creates output namely DUMP (to console) or STORE you can also use command DESCRIBE to get the structure of an alias and EXPLAIN to see the map/reduce plan

so basically DUMP A; will give you all the records in A


Please try to run in the windows command window.

C:\FAST\JDK64\1.6.0.31/bin/java -Xmx1000m -Dpig.log.dir=C:/cygwin/home/$USERNAME$/nubes/pig/logs -Dpig.log.file=pig.log -Dpig.home.dir=C:/cygwin/home/$USERNAME$/nubes/pig/ -classpath C:/cygwin/home/$USERNAME$/nubes/pig/conf;C;C:/FAST/JDK64/1.6.0.31/lib/tools.jar;C:/cygwin/home/$USERNAME$/nubes/pig/lib/jython-standalone-2.5.3.jar;C:/cygwin/home/$USERNAME$/nubes/pig/conf;C:/cygwin/home/$USERNAME$/nubes/hadoop/conf;C:/cygwin/home/$USERNAME$/nubes/pig/pig-0.11.1.jar org.apache.pig.Main -x local

Replace $USERNAME$ with your user id accordingly ..

Modify the class path and conf path accordingly ..

It works well in both local as well as map reduce mode ..