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

------------------------------------------------------------------------------
  }}}
  
  
- 
  === Environment ===
  
  Unix and Windows users need to install and set up Java (including $JAVA_HOME 
and $PATH).
@@ -58, +57 @@

  To run Pig in local mode, you only need access to a single machine. To make 
things simple, copy these files to your current working directory (you may want 
to create a temp directory and move to it):
  
    * The /etc/passwd file
-   * The pig.jar file, located in your SVN tree (see BuildPig)
+   * The pig.jar file, created when you build Pig (see BuildPig)
-   * The sample code files (XXX.pig and XXX.java) located on this page
+   * The sample code files (id.pig and idlocal.java) located on this page
  
  === Grunt Shell ===
  To run Pig’s Grunt shell in local mode, follow these instructions.
@@ -109, +108 @@

  From your current working directory, run:
  
  {{{ 
- $ pig -x local XXX.pig
+ $ pig -x local id.pig
  }}}
  
  The results are displayed  to your terminal screen.
@@ -118, +117 @@

  
  From your current working directory, run:
  {{{
- $ java -cp pig.jar org.apache.pig.Main -x local XXX.pig
+ $ java -cp pig.jar org.apache.pig.Main -x local id.pig
  Or
- $ java –jar pig.jar –x local XXX.pig
+ $ java –jar pig.jar –x local id.pig
  }}}
  
  The results are displayed to your terminal screen.
@@ -132, +131 @@

  
  From your current working directory, compile the program:
  {{{
- $ javac -cp pig.jar XXX.java
+ $ javac -cp pig.jar idlocal.java
  }}}
  
- Note: XXX.class is written to your current working directory. Include “.” 
in the class path when you run the program.
+ Note: idlocal.class is written to your current working directory. Include 
“.” in the class path when you run the program.
  
  From your current working directory, run the program:
  {{{
- Unix:   $ java -cp pig.jar:. XXX
+ Unix:   $ java -cp pig.jar:. idlocal
- Cygwin: $ java –cp ‘.;pig.jar’ XXX
+ Cygwin: $ java –cp ‘.;pig.jar’ idlocal
  }}}
  
- To view the results, check the output file, XXX.out.
+ To view the results, check the output file, id.out.
  
  = Hadoop Mode =
  
@@ -152, +151 @@

  To run Pig in hadoop (mapreduce) mode, you need access to a Hadoop cluster. 
You also need to copy these files to your home or current working directory.
  
    * The /etc/passwd file
-   * The pig.jar file, located in your SVN tree (see BuildPig)
+   * The pig.jar file, created when you build Pig (see BuildPig)
-   * The sample code files (XXX.pig and XXX.java) located on this page
+   * The sample code files (id.pig and idhadoop.java) located on this page
  
  === Grunt Shell ===
  To run Pig’s Grunt shell in hadoop (mapreduce) mode, follow these 
instructions. When you begin the session, Pig will allocate a 15-node cluster. 
When you quit the session, Pig will deallocate the nodes.
@@ -166, +165 @@

  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; 
+ grunt> B = foreach A generate $0 as id; 
  grunt> dump B; 
  }}}
  
@@ -177, +176 @@

  
  From your current working directory, run:
  {{{
- $ pig XXX.pig
+ $ pig id.pig
  }}}
  
  The results are displayed  to your terminal screen.
@@ -196, +195 @@

  $ javac -cp pig.jar idhadoop.java
  }}}
  
- Note: XXX.class is written to your current working directory. Include “.” 
in the class path when you run the program.
+ Note: idhadoop.class is written to your current working directory. Include 
“.” in the class path when you run the program.
  
  From your current working directory, run the program:
  {{{
- Unix:   $ java -cp pig.jar:.:$HADOOPDIR XXX
+ Unix:   $ java -cp pig.jar:.:$HADOOPDIR idhadoop
- Cygwin: $ java –cp ‘.;pig.jar;$HADOOPDIR’ XXX
+ Cygwin: $ java –cp ‘.;pig.jar;$HADOOPDIR’ idhadoop
  }}}
  
  To view the results, check the idout directory on your Hadoop system.

Reply via email to