您的位置:首页 > 编程语言 > Java开发

eclipse插件之pigpen安装与配置

2015-11-11 21:33 761 查看
原文地址:http://wiki.apache.org/pig/PigPen

PigPen

[align=left]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.[/align]

Getting PigPen
The PigPen plugin jar can be obtained from
here.
[align=left]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.[/align]

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 theJobConf properties.

Diagram 1 : Setting the
ConfigurationPath




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



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



Diagram 4 : Operator Graph



Running the Example Generator
[align=left]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.[/align]
Diagram 5 : Pig and Hadoop icons are the 4th and 5th from left.


Diagram 6 : Output of the Example Generator

The following diagram shows the Pig Examples window

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: