[Solved-2 Solutions] Pig in grunt mode ?


If you have installed cygwin, hadoop and pig in windows. The configuration seems ok, as you can run pig scripts in batch and embedded mode. When you try to run pig in grunt mode, a simple command like

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

When you press Enter, nothing occurs. The cursor goes to the next line and the grunt> prompt does not appear at all anymore.

How can you solve this ?

Solution 1:

  • The following command does not result in any activity by pig.
raw = LOAD 'excite.log' USING PigStorage('\t') AS (user, time, query);
  • But if we invoke a command that results in using data from variable raw using some map-reduce that when we 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);
grunt> A = load 'passwd' using PigStorage(':'); 

Solution 2:

  • Pig will only process the commands when we use a command that creates output namely DUMP or STORE we 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

Related Searches to Pig in grunt mode