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/PigTutorial ------------------------------------------------------------------------------ * To run the scripts in local mode, no Hadoop or DFS installation is required. All files are installed and run from your local host and file system. * To run the scripts on a Hadoop cluster, you need access to a Hadoop cluster and DFS installation. - The Pig JAR file (pig.jar) and the Pig tutorial file include everything you need to get started. + The Pig JAR file (pig.jar) and the Pig tutorial file (*.tar.gz) include everything you need to get started. === Java Installation === - Your run-time environment should include '''Java 1.5'''. + Your run-time environment should include '''Java 1.5'''. + Set the JAVA_HOME environment variable to the root of your Java installation. === Pig Installation === To install Pig, do the following: - 1. Download the Pig JAR file ('''pig.jar''') and move it to the appropriate directory. For example, /home/me/pig. + 1. Download the Pig JAR file (pig.jar) and move it to the appropriate directory. For example: /home/me/pig. - 1. Define an environment variable with the location of the Pig JAR file. For example, export PIGDIR=/home/me/pig (bash, sh) or setenv PIGDIR /home/me/pig (tcsh, csh). + 1. Define an environment variable with the location of the Pig JAR file. For example: export PIGDIR=/home/me/pig (bash, sh) or setenv PIGDIR /home/me/pig (tcsh, csh). === Pig Scripts and Local Mode === To install and run the Pig scripts in local mode, do the following: - 1. Download and unzip the Pig tutorial file to your local directory (the Pig tutorial files are described below). + 1. Download and unzip the Pig tutorial file (*.tar.gz) to your local directory (the Pig tutorial files are described below). 1. Execute the following command (using either tutorial-local.pig or tutorial-join-local.pig) {{{ $ java -cp $PIGDIR/pig.jar org.apache.pig.Main -x local tutorial-local.pig @@ -43, +44 @@ === Pig Scripts and Hadoop Cluster === To install and run the Pig scripts on a Hadoop cluster, do the following: - 1. Download and unzip the Pig tutorial file to your local directory (the Pig tutorial files are described below). + 1. Download and unzip the Pig tutorial file (*.tar.gz) to your local directory (the Pig tutorial files are described below). 1. Copy the exite.log file to your DFS directory. {{{ $ hadoop dfs âcopyFromLocal tutorial/excite.log . @@ -84, +85 @@ == Pig Tutorial-1 == - Pig Tutorial-1 (tutorial.pig or tutorial-local.pig) does the following: + The Pig Tutorial-1 script (tutorial.pig or tutorial-local.pig) does the following: * Registers the tutorial JAR file so that the included user-defined functions (UDFs) can be called in the script. * Loads the excite log file (excite.log or excite-small.log) into the ârawâ bag as an array of records with the fields user, time, and query. @@ -102, +103 @@ == Pig Tutorial-2 == - Pig Tutorial-2 (tutorial-join.pig or tutorial-join-local.pig) does the following: + The Pig Tutorial-2 script (tutorial-join.pig or tutorial-join-local.pig) does the following: * Registers the tutorial JAR file so that the included user-defined functions (UDFs) can be called in the script. * Loads the excite log file (excite.log or excite-small.log) into the ârawâ bag as an array of records with the fields user, time, and query.