Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Pig Wiki" for change 
notification.

The following page has been changed by CorinneC:
http://wiki.apache.org/pig/RunPig

------------------------------------------------------------------------------
  
  Pig has two run modes or exectypes, local and hadoop (currently called 
mapreduce). To run Pig in local mode, you need access to a single machine. To 
run Pig in hadoop (mapreduce) mode, you need access to a Hadoop cluster.
  
- To get a listing of all Pig commands use 
+ To get a listing of all Pig commands, including the run modes, use 
  {{{
  $ pig –help
  }}}
@@ -16, +16 @@

  == Run Ways ==
  
  You can run Pig three ways – using either local mode or hadoop (mapreduce) 
mode:
-   * Grunt Shell: Enter Pig commands manually using Pig’s interactive shell, 
Grunt. 
+   * '''Grunt Shell''': Enter Pig commands manually using Pig’s interactive 
shell, Grunt. 
-   * Script File: Place Pig commands in a script file and run the script.
+   * '''Script File''': Place Pig commands in a script file and run the script.
-   * Embedded Program: Embed Pig commands in a host language (Java) and run 
the program.
+   * '''Embedded Program''': Embed Pig commands in a host language (Java) and 
run the program.
  
  == Sample Code ==
- The sample code files you need to run the examples include: XXX.pig and 
XXX.java.
+ The sample code files you need to run the examples on this page include: 
XXX.pig and XXX.java.
   
- The examples are based on these Pig commands, which extract all user IDs from 
the passwd file. 
+ The examples are based on these Pig commands, which extract all user IDs from 
the /etc/passwd file. 
  
  {{{ 
  A = load 'passwd' using PigStorage(':'); 
@@ -58, +58 @@

  
    * Copy the sample code files (XXX.pig and XXX.java) to your current working 
directory.
  
+ == Local Mode ==
+ This section shows you how to run Pig in local mode, using the Grunt shell, a 
Pig script, and an embedded program.
+ 
+ To run Pig in local mode, you only need access to a single machine. 
+ 
+ === Grunt Shell ===
+ To run Pig’s Grunt shell in local mode, follow these instructions.
+ 
+ First, point $PIG_CLASSPATH to the pig.jar file (in your current working 
directory). Example:
+ {{{
+ $ export PIG_CLASSPATH=./pig.jar
+ }}} 
+ 
+ (1) With Pig Script
+ 
+ From your local directory, run:
+ {{{
+ $ pig -x local
+ }}}
+ 
+ The Grunt shell is invoked and you can enter commands at the prompt.
+ {{{
+ grunt> A = load 'passwd' using PigStorage(':'); 
+ grunt> B = foreach A generate $0 as id; 
+ grunt> dump B; 
+ }}}
+ 
+ (2) Without Pig Script
+ 
+ From your current working directory, run:
+ {{{
+ $ java -cp pig.jar org.apache.pig.Main -x local
+ Or
+ $ java –jar pig.jar –x local
+ }}}
+ 
+ The Grunt shell is invoked and you can enter commands at the prompt.
+ 
+ 
+ 
+ === Script File ===
+ 
+ === Embedded Program ===
+ 

Reply via email to