Differences between revisions 4 and 5
Revision 4 as of 2008-11-14 15:50:11
Size: 2334
Editor: vpn-nat
Revision 5 as of 2009-09-20 23:38:08
Size: 2360
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
The PigPen plugin jar can be obtained from [http://issues.apache.org/jira/secure/attachment/12393772/org.apache.pig.pigpen_0.0.1.jar here]. The PigPen plugin jar can be obtained from [[http://issues.apache.org/jira/secure/attachment/12393772/org.apache.pig.pigpen_0.0.1.jar|here]].
Line 14: Line 14:
attachment:ConfigurationPath.png {{attachment:ConfigurationPath.png}}
Line 21: Line 21:
attachment:pigPenEditor.png {{attachment:pigPenEditor.png}}
Line 28: Line 28:
attachment:textEditor.png {{attachment:textEditor.png}}
Line 31: Line 31:
attachment:Graph.png {{attachment:Graph.png}}
Line 37: Line 37:
attachment:ToolBar.png {{attachment:ToolBar.png}}
Line 42: Line 42:
attachment:PigExample.png {{attachment:PigExample.png}}


PigPen is an eclipse plugin that helps users create pig-scripts, test them using the example generator and then submit them to a hadoop cluster as well.

Getting PigPen

The PigPen plugin jar can be obtained from here.

The jar can be placed in the eclipse/plugins/ folder. It is a good idea to start eclipse with a "-clean" option to ensure that the latest version of the plugins is being used.

Using PigPen

To start using PigPen you will have to set the path to the directory containing both hadoop-site.xml and pig.properties for the plugin to connect to the cluster. This can be done by going to Eclipse preferences -> Pig and adding a new variable *ConfigurationPath* to the JobConf properties.

Diagram 1 : Setting the ConfigurationPath ConfigurationPath.png

1. Create a new "General" Project in eclipse. 2. Add a new file to the project. Make sure the file has an extension ".pig". 3. This should start the Pig editor with the new empty file. PigPen has 3 editors. The *Operator Graph* shows you the query in a graph form. The *Header* is to be used with the Operator Graph for registering jars or giving define directives. The *Pig Script* is the text editor. The figure below shows the PigPen editor.

Diagram 2 : PigPen editor pigPenEditor.png

4. Currently the script can only be edited using the *Pig Script* text editor. The synchronization between the graph and the text editor happens when you save the script. So its a good idea to save the changes in the text editor before switching views.

The following screenshots show the usage of the *Pig Script* editor.

Diagram 3 : Sample Script textEditor.png

Diagram 4 : Operator Graph Graph.png

Running the Example Generator

Once the script is error-free, you can run the example generator by clicking on the Pig icon in the toolbar. Once satisfied with the results, you can submit the script to the cluster by clicking on the Hadoop icon.

Diagram 5 : Pig and Hadoop icons are the 4th and 5th from left. ToolBar.png

The following diagram shows the Pig Examples window

Diagram 6 : Output of the Example Generator PigExample.png

PigPen (last edited 2009-09-20 23:38:08 by localhost)