
<link rel="stylesheet" href="docbook.css" type="text/css" media="screen" title="no title" charset="utf-8"></link>

Pig Editor
==========

The Pig Editor application allows you to define Pig scripts, run
scripts, and view the status of jobs. For information about Pig, see
[Pig Documentation](http://archive.cloudera.com/cdh4/cdh/4/pig/).

Pig Editor Installation and Configuration
-----------------------------------------

Pig Editor is one of the applications installed as part of Hue. For
information about installing and configuring Hue, see the Hue Installation manual.

Pig Editor assumes an existing Pig installation. The Hue installation
instructions include the configuration necessary for Pig Editor to
access Pig.

Starting Pig Editor
-------------------

Click the **Pig Editor** icon (![image](images/icon_pig_24.png)) in the
navigation bar at the top of the Hue browser page. The Pig Editor opens
with three tabs:

-   Editor - editor where you can create, edit, run, save, copy, and
    delete scripts and edit script properties.
-   Scripts - script manager where you can create, open, run, copy, and
    delete scripts.
-   Dashboard - dashboard where you can view running and completed
    scripts and view the log of a job.

Pig Scripts
-----------

### Installing the Example Scripts

![image](images/note.jpg) **Note**: You must be a superuser to perform
this task.

1.  Click ![image](images/quick_start.png). The Quick Start Wizard
    opens.
2.  Click **Step 2: Examples**.
3.  Click **Pig Editor**.

### Creating a Script

1.  In either the Editor or Scripts screen, click New script. Edit the
    script as desired.
2.  Click Edit Properties. In the Script name field, type a name for the
    script.
3.  Click Save.

### Opening a Script

1.  Click the Scripts tab.
2.  In the list of scripts, click a script.

### Running a Script

1.  Do one of the following:
    -   In the Editor screen, click the Run button.
    -   In the Scripts screen, check the checkbox next to a script and
        click the Run button.

### Viewing the Result of Running a Script

1.  Click the Dashboard tab.
2.  Click a job.
