pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Pig Wiki] Trivial Update of "RunPig" by CorinneC
Date Wed, 10 Sep 2008 22:36:28 GMT
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 ===
+ 

Mime
View raw message