You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by bi...@apache.org on 2013/04/02 05:32:42 UTC

svn commit: r1463367 [3/11] - in /pig/site: author/src/documentation/content/xdocs/ publish/ publish/docs/r0.11.1/ publish/docs/r0.11.1/images/ publish/docs/r0.11.1/skin/ publish/docs/r0.11.1/skin/css/ publish/docs/r0.11.1/skin/images/ publish/docs/r0....

Added: pig/site/publish/docs/r0.11.1/basic.pdf
URL: http://svn.apache.org/viewvc/pig/site/publish/docs/r0.11.1/basic.pdf?rev=1463367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: pig/site/publish/docs/r0.11.1/basic.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: pig/site/publish/docs/r0.11.1/broken-links.xml
URL: http://svn.apache.org/viewvc/pig/site/publish/docs/r0.11.1/broken-links.xml?rev=1463367&view=auto
==============================================================================
--- pig/site/publish/docs/r0.11.1/broken-links.xml (added)
+++ pig/site/publish/docs/r0.11.1/broken-links.xml Tue Apr  2 03:32:39 2013
@@ -0,0 +1,2 @@
+<broken-links>
+</broken-links>

Added: pig/site/publish/docs/r0.11.1/cmds.html
URL: http://svn.apache.org/viewvc/pig/site/publish/docs/r0.11.1/cmds.html?rev=1463367&view=auto
==============================================================================
--- pig/site/publish/docs/r0.11.1/cmds.html (added)
+++ pig/site/publish/docs/r0.11.1/cmds.html Tue Apr  2 03:32:39 2013
@@ -0,0 +1,1125 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.9">
+<meta name="Forrest-skin-name" content="pelt">
+<title>Shell and Utility Commands</title>
+<link type="text/css" href="skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
+<link type="text/css" href="skin/profile.css" rel="stylesheet">
+<script src="skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://hadoop.apache.org/">Hadoop</a> &gt; <a href="http://hadoop.apache.org/pig/">Pig</a><script src="skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+    |header
+    +-->
+<div class="header">
+<!--+
+    |start group logo
+    +-->
+<div class="grouplogo">
+<a href="http://hadoop.apache.org/"><img class="logoImage" alt="Hadoop" src="images/hadoop-logo.jpg" title="Apache Hadoop"></a>
+</div>
+<!--+
+    |end group logo
+    +-->
+<!--+
+    |start Project Logo
+    +-->
+<div class="projectlogo">
+<a href="http://hadoop.apache.org/pig/"><img class="logoImage" alt="Pig" src="images/pig-logo.gif" title="A platform for analyzing large datasets."></a>
+</div>
+<!--+
+    |end Project Logo
+    +-->
+<!--+
+    |start Search
+    +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
+                    <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+    |end search
+    +-->
+<!--+
+    |start Tabs
+    +-->
+<ul id="tabs">
+<li>
+<a class="unselected" href="http://hadoop.apache.org/pig/">Project</a>
+</li>
+<li>
+<a class="unselected" href="http://wiki.apache.org/pig/">Wiki</a>
+</li>
+<li class="current">
+<a class="selected" href="index.html">Pig 0.11.1 Documentation</a>
+</li>
+</ul>
+<!--+
+    |end Tabs
+    +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+    |start Subtabs
+    +-->
+<div id="level2tabs"></div>
+<!--+
+    |end Endtabs
+    +-->
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+
+             &nbsp;
+           </div>
+<!--+
+    |start Menu, mainarea
+    +-->
+<!--+
+    |start Menu
+    +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', 'skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Pig</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="index.html">Overview</a>
+</div>
+<div class="menuitem">
+<a href="start.html">Getting Started</a>
+</div>
+<div class="menuitem">
+<a href="basic.html">Pig Latin Basics</a>
+</div>
+<div class="menuitem">
+<a href="func.html">Built In Functions</a>
+</div>
+<div class="menuitem">
+<a href="udf.html">User Defined Functions</a>
+</div>
+<div class="menuitem">
+<a href="cont.html">Control Structures</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">Shell and Utililty Commands</div>
+</div>
+<div class="menuitem">
+<a href="perf.html">Performance and Efficiency</a>
+</div>
+<div class="menuitem">
+<a href="test.html">Testing and Diagnostics</a>
+</div>
+<div class="menuitem">
+<a href="pig-index.html">Index</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_1.2', 'skin/')" id="menu_1.2Title" class="menutitle">Miscellaneous</div>
+<div id="menu_1.2" class="menuitemgroup">
+<div class="menuitem">
+<a href="api/">API Docs</a>
+</div>
+<div class="menuitem">
+<a href="jdiff/changes.html">API Changes</a>
+</div>
+<div class="menuitem">
+<a href="https://cwiki.apache.org/confluence/display/PIG">Wiki</a>
+</div>
+<div class="menuitem">
+<a href="https://cwiki.apache.org/confluence/display/PIG/FAQ">FAQ</a>
+</div>
+<div class="menuitem">
+<a href="http://hadoop.apache.org/pig/releases.html">Release Notes</a>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+  |alternative credits
+  +-->
+<div id="credit2"></div>
+</div>
+<!--+
+    |end Menu
+    +-->
+<!--+
+    |start content
+    +-->
+<div id="content">
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="cmds.pdf"><img alt="PDF -icon" src="skin/images/pdfdoc.gif" class="skin"><br>
+        PDF</a>
+</div>
+<h1>Shell and Utility Commands</h1>
+<div id="front-matter">
+<div id="minitoc-area">
+<ul class="minitoc">
+<li>
+<a href="#shell-cmds">Shell Commands</a>
+<ul class="minitoc">
+<li>
+<a href="#fs">fs</a>
+</li>
+<li>
+<a href="#sh">sh</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#utillity-cmds">Utility Commands</a>
+<ul class="minitoc">
+<li>
+<a href="#clear">clear</a>
+</li>
+<li>
+<a href="#exec">exec</a>
+</li>
+<li>
+<a href="#help">help</a>
+</li>
+<li>
+<a href="#history">history</a>
+</li>
+<li>
+<a href="#kill">kill</a>
+</li>
+<li>
+<a href="#quit">quit</a>
+</li>
+<li>
+<a href="#run">run</a>
+</li>
+<li>
+<a href="#set">set</a>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+
+<!-- ====================================================================== -->
+<!-- Shell COMMANDS-->
+   
+<a name="shell-cmds"></a>
+<h2 class="h3">Shell Commands</h2>
+<div class="section">
+<a name="fs"></a>
+<h3 class="h4">fs</h3>
+<p>Invokes any FsShell command from within a Pig script or the Grunt shell.</p>
+<a name="Syntax"></a>
+<h4>Syntax </h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>fs subcommand subcommand_parameters </p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+      
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>subcommand</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>The FsShell command.</p>
+            
+</td>
+         
+</tr>
+               
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>subcommand_parameters</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>The FsShell command parameters.</p>
+            
+</td>
+         
+</tr>
+   
+</table>
+<a name="Usage"></a>
+<h4>Usage</h4>
+<p>Use the fs command to invoke any FsShell command from within a Pig script or Grunt shell. 
+   The fs command greatly extends the set of supported file system commands and the capabilities
+   supported for existing commands such as ls that will now support globing. For a complete list of
+   FsShell commands, see 
+   <a href="http://hadoop.apache.org/common/docs/current/file_system_shell.html">File System Shell Guide</a>
+</p>
+<a name="Examples"></a>
+<h4>Examples</h4>
+<p>In these examples a directory is created, a file is copied, a file is listed.</p>
+<pre class="code">
+fs -mkdir /tmp
+fs -copyFromLocal file-x file-y
+fs -ls file-y
+</pre>
+<a name="sh"></a>
+<h3 class="h4">sh</h3>
+<p>Invokes any sh shell command from within a Pig script or the Grunt shell.</p>
+<a name="Syntax-N1008E"></a>
+<h4>Syntax </h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>sh subcommand subcommand_parameters </p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms-N100A2"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+      
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>subcommand</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>The sh shell command.</p>
+            
+</td>
+         
+</tr>
+               
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>subcommand_parameters</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>The sh shell command parameters.</p>
+            
+</td>
+         
+</tr>
+   
+</table>
+<a name="Usage-N100D2"></a>
+<h4>Usage</h4>
+<p>Use the sh command to invoke any sh shell command from within a Pig script or Grunt shell.</p>
+<p> 
+ Note that only real programs can be run form the sh command. Commands such as cd are not programs 
+ but part of the shell environment and as such cannot be executed unless the user invokes the shell explicitly, like "bash cd".
+</p>
+<a name="Example"></a>
+<h4>Example</h4>
+<p>In this example the ls command is invoked.</p>
+<pre class="code">
+grunt&gt; sh ls 
+bigdata.conf 
+nightly.conf 
+..... 
+grunt&gt; 
+</pre>
+</div>
+ 
+ <!-- ======================================================== -->         
+        
+   
+<a name="utillity-cmds"></a>
+<h2 class="h3">Utility Commands</h2>
+<div class="section">
+<a name="clear"></a>
+<h3 class="h4">clear</h3>
+<p>Clear the screen of Pig grunt shell and position the cursor at top of the screen.</p>
+<a name="Syntax-N10102"></a>
+<h4>Syntax </h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+                   
+<tr>
+                       
+<td colspan="1" rowspan="1">
+                           
+<p>clear</p>
+                       
+</td>
+                   
+</tr> 
+               
+</table>
+<a name="Terms-N10117"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+                   
+<tr>
+                       
+<td colspan="1" rowspan="1">
+                           
+<p>key</p>
+                       
+</td>
+                       <td colspan="1" rowspan="1">
+                           
+<p>Description.</p>
+                       
+</td>
+                   
+</tr>
+                   
+<tr>
+                       
+<td colspan="1" rowspan="1">
+                           
+<p>none</p>
+                       
+</td>
+                       <td colspan="1" rowspan="1">
+                           
+<p>no parameters</p>
+                       
+</td>
+                   
+</tr> 
+               
+</table>
+<a name="Example-N10146"></a>
+<h4>Example</h4>
+<p>In this example the clear command clean up Pig grunt shell.</p>
+<pre class="code">
+grunt&gt; clear</pre>
+<a name="exec"></a>
+<h3 class="h4">exec</h3>
+<p>Run a Pig script.</p>
+<a name="Syntax-N10160"></a>
+<h4>Syntax</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>exec [&ndash;param param_name = param_value] [&ndash;param_file file_name] [script]&nbsp; </p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms-N10174"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+    
+        
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>&ndash;param param_name = param_value</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>See <a href="cont.html#Parameter-Sub">Parameter Substitution</a>.</p>
+            
+</td>
+        
+</tr>
+
+        
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>&ndash;param_file file_name</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>See <a href="cont.html#Parameter-Sub">Parameter Substitution</a>. </p>
+            
+</td>
+        
+</tr>
+   
+      
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>script</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>The name of a Pig script.</p>
+            
+</td>
+         
+</tr>
+         
+    
+   
+</table>
+<a name="Usage-N101BE"></a>
+<h4>Usage</h4>
+<p>Use the exec command to run a Pig script with no interaction between the script and the Grunt shell (batch mode). Aliases defined in the script are not available to the shell; however, the files produced as the output of the script and stored on the system are visible after the script is run. Aliases defined via the shell are not available to the script. </p>
+<p>With the exec command, store statements will not trigger execution; rather, the entire script is parsed before execution starts. Unlike the run command, exec does not change the command history or remembers the handles used inside the script. Exec without any parameters can be used in scripts to force execution up to the point in the script where the exec occurs. </p>
+<a name="exec-debug"></a>
+<p id="exec-debug">For comparison, see the <a href="#run">run</a> command. Both the exec and run commands are useful for debugging because you can modify a Pig script in an editor and then rerun the script in the Grunt shell without leaving the shell. Also, both commands promote Pig script modularity as they allow you to reuse existing components.</p>
+<a name="Examples-N101D3"></a>
+<h4>Examples</h4>
+<p>In this example the script is displayed and run.</p>
+<pre class="code">
+grunt&gt; cat myscript.pig
+a = LOAD 'student' AS (name, age, gpa);
+b = LIMIT a 3;
+DUMP b;
+
+grunt&gt; exec myscript.pig
+(alice,20,2.47)
+(luke,18,4.00)
+(holly,24,3.27)
+</pre>
+<p>In this example parameter substitution is used with the exec command.</p>
+<pre class="code">
+grunt&gt; cat myscript.pig
+a = LOAD 'student' AS (name, age, gpa);
+b = ORDER a BY name;
+
+STORE b into '$out';
+
+grunt&gt; exec &ndash;param out=myoutput myscript.pig
+</pre>
+<p>In this example multiple parameters are specified.</p>
+<pre class="code">
+grunt&gt; exec &ndash;param p1=myparam1 &ndash;param p2=myparam2 myscript.pig
+</pre>
+<a name="help"></a>
+<h3 class="h4">help</h3>
+<p>Prints a list of Pig commands or properties.</p>
+<a name="Syntax-N101FB"></a>
+<h4>Syntax</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>-help [properties] &nbsp;</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms-N1020F"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>properties</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>List Pig properties.</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Usage-N1022B"></a>
+<h4>Usage</h4>
+<p>The help command prints a list of Pig commands or properties.</p>
+<a name="Example-N10234"></a>
+<h4>Example</h4>
+<p>Use "-help" to get a list of commands.</p>
+<pre class="code">
+$ pig -help
+
+Apache Pig version 0.8.0-dev (r987348)
+compiled Aug 19 2010, 16:38:44
+
+USAGE: Pig [options] [-] : Run interactively in grunt shell.
+       Pig [options] -e[xecute] cmd [cmd ...] : Run cmd(s).
+       Pig [options] [-f[ile]] file : Run cmds found in file.
+  options include:
+    -4, -log4jconf - Log4j configuration file, overrides log conf
+    -b, -brief - Brief logging (no timestamps)
+    -c, -check - Syntax check
+<em>etc &hellip;</em>
+</pre>
+<p>Use "-help properties" to get a list of properties.</p>
+<pre class="code">
+$ pig -help properties
+
+The following properties are supported:
+    Logging:
+        verbose=true|false; default is false. This property is the same as -v switch
+        brief=true|false; default is false. This property is the same as -b switch
+        debug=OFF|ERROR|WARN|INFO|DEBUG; default is INFO. This property is the same as -d switch
+        aggregate.warning=true|false; default is true. If true, prints count of warnings
+            of each type rather than logging each warning.
+<em>etc &hellip;</em>
+</pre>
+<a name="history"></a>
+<h3 class="h4">history</h3>
+<p>Display the list of statements used so far.</p>
+<a name="Syntax-N10259"></a>
+<h4>Syntax</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+                   
+<tr>
+                       
+<td colspan="1" rowspan="1">
+                           
+<p>history [-n]</p>
+                       
+</td>
+                   
+</tr> 
+               
+</table>
+<a name="Terms-N1026E"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+                   
+<tr>
+                       
+<td colspan="1" rowspan="1">
+                           
+<p>key</p>
+                       
+</td>
+                       <td colspan="1" rowspan="1">
+                           
+<p>Description.</p>
+                       
+</td>
+                   
+</tr>
+                   
+<tr>
+                       
+<td colspan="1" rowspan="1">
+                           
+<p>-n</p>
+                       
+</td>
+                       <td colspan="1" rowspan="1">
+                           
+<p>Omit line numbers in the list.</p>
+                       
+</td>
+                   
+</tr>
+               
+</table>
+<a name="Usage-N1029E"></a>
+<h4>Usage</h4>
+<p>The history command shows the statements used so far.</p>
+<a name="Example-N102A7"></a>
+<h4>Example</h4>
+<p>In this example the history command shows all the statements with line numbers and without them.</p>
+<pre class="code">
+grunt&gt; a = LOAD 'student' AS (name, age, gpa);
+grunt&gt; b = order a by name;
+grunt&gt; history
+1 a = LOAD 'student' AS (name, age, gpa);
+2 b = order a by name;
+
+grunt&gt; c = order a by name;
+grunt&gt; history -n
+a = LOAD 'student' AS (name, age, gpa);
+b = order a by name;
+c = order a by name;</pre>
+<a name="kill"></a>
+<h3 class="h4">kill</h3>
+<p>Kills a job.</p>
+<a name="Syntax-N102C1"></a>
+<h4>Syntax</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>kill jobid</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms-N102D5"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>jobid</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>The job id.</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Usage-N102F1"></a>
+<h4>Usage</h4>
+<p>Use the kill command to kill a Pig job based on the job id.</p>
+<p>The kill command will attempt to kill any MapReduce jobs associated with the Pig job. Under certain conditions, however, this may fail; for example, when a Pig job is killed and does not have a chance to call its shutdown procedures.</p>
+<a name="Example-N102FE"></a>
+<h4>Example</h4>
+<p>In this example the job with id job_0001 is killed.</p>
+<pre class="code">
+grunt&gt; kill job_0001
+</pre>
+<a name="quit"></a>
+<h3 class="h4">quit</h3>
+<p>Quits from the Pig grunt shell.</p>
+<a name="Syntax-N10317"></a>
+<h4>Syntax</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>exit</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms-N1032B"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>none</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>no parameters</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Usage-N10347"></a>
+<h4>Usage</h4>
+<p>The quit command enables you to quit or exit the Pig grunt shell.</p>
+<a name="Example-N10350"></a>
+<h4>Example</h4>
+<p>In this example the quit command exits the Pig grunt shall.</p>
+<pre class="code">
+grunt&gt; quit
+</pre>
+<a name="run"></a>
+<h3 class="h4">run</h3>
+<p>Run a Pig script.</p>
+<a name="Syntax-N1036A"></a>
+<h4>Syntax</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>run [&ndash;param param_name = param_value] [&ndash;param_file file_name] script&nbsp;</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms-N1037E"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+    
+         
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>&ndash;param param_name = param_value</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>See <a href="cont.html#Parameter-Sub">Parameter Substitution</a>.</p>
+            
+</td>
+         
+</tr>
+
+         
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>&ndash;param_file file_name</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>See <a href="cont.html#Parameter-Sub">Parameter Substitution</a>. </p>
+            
+</td>
+         
+</tr>
+      
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>script</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>The name of a Pig script.</p>
+            
+</td>
+         
+</tr>
+         
+    
+   
+</table>
+<a name="Usage-N103C8"></a>
+<h4>Usage</h4>
+<p>Use the run command to run a Pig script that can interact with the Grunt shell (interactive mode). The script has access to aliases defined externally via the Grunt shell. The Grunt shell has access to aliases defined within the script. All commands from the script are visible in the command history. </p>
+<p>With the run command, every store triggers execution. The statements from the script are put into the command history and all the aliases defined in the script can be referenced in subsequent statements after the run command has completed. Issuing a run command on the grunt command line has basically the same effect as typing the statements manually. </p>
+<p>For comparison, see the <a href="#exec">exec</a> command. Both the run and exec commands are useful for debugging because you can modify a Pig script in an editor and then rerun the script in the Grunt shell without leaving the shell. Also, both commands promote Pig script modularity as they allow you to reuse existing components.</p>
+<a name="Example-N103DC"></a>
+<h4>Example</h4>
+<p>In this example the script interacts with the results of commands issued via the Grunt shell.</p>
+<pre class="code">
+grunt&gt; cat myscript.pig
+b = ORDER a BY name;
+c = LIMIT b 10;
+
+grunt&gt; a = LOAD 'student' AS (name, age, gpa);
+
+grunt&gt; run myscript.pig
+
+grunt&gt; d = LIMIT c 3;
+
+grunt&gt; DUMP d;
+(alice,20,2.47)
+(alice,27,1.95)
+(alice,36,2.27)
+</pre>
+<p>In this example parameter substitution is used with the run command.</p>
+<pre class="code">
+grunt&gt; a = LOAD 'student' AS (name, age, gpa);
+
+grunt&gt; cat myscript.pig
+b = ORDER a BY name;
+STORE b into '$out';
+
+grunt&gt; run &ndash;param out=myoutput myscript.pig
+</pre>
+<a name="set"></a>
+<h3 class="h4">set</h3>
+<p>Assigns values to keys used in Pig.</p>
+<a name="Syntax-N103FC"></a>
+<h4>Syntax</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>set key 'value'</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Terms-N10410"></a>
+<h4>Terms</h4>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>key</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Key (see table). Case sensitive.</p>
+            
+</td>
+         
+</tr>
+         
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>value</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Value for key (see table). Case sensitive.</p>
+            
+</td>
+         
+</tr> 
+   
+</table>
+<a name="Usage-N10440"></a>
+<h4>Usage</h4>
+<p>Use the set command to assign values to keys, as shown in the table. All keys and their corresponding values (for Pig and Hadoop) are case sensitive.  </p>
+<table class="ForrestTable" cellspacing="1" cellpadding="4">
+       
+      
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>Key </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Value </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Description </p>
+            
+</td>
+         
+</tr>
+                     
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>default_parallel</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>a whole number </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Sets the number of reducers for all MapReduce jobs generated by Pig 
+              (see  <a href="perf.html#Parallel">Use the Parallel Features</a>).</p>
+            
+</td>
+         
+</tr>
+         
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>debug </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>on/off </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Turns debug-level logging on or off. </p>
+            
+</td>
+         
+</tr>
+         
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>job.name </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Single-quoted string that contains the job name.</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Sets user-specified name for the job </p>
+            
+</td>
+            
+</tr>
+
+         
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>job.priority </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Acceptable values (case insensitive): very_low, low, normal, high, very_high </p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>Sets the priority of a Pig job.</p>
+            
+</td>
+            
+</tr>
+
+         
+<tr>
+            
+<td colspan="1" rowspan="1">
+               
+<p>stream.skippath</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>String that contains the path.</p>
+            
+</td>
+            <td colspan="1" rowspan="1">
+               
+<p>For streaming, sets the path from which not to ship data (see <a href="basic.html#DEFINE-udfs">DEFINE (UDFs, streaming)</a> and <a href="basic.html#autoship"> About Auto-Ship</a>).</p>
+            
+</td>
+            
+</tr>
+   
+</table>
+<p></p>
+<p>
+All Pig and Hadoop properties can be set, either in the Pig script or via the Grunt command line.
+   </p>
+<a name="Examples-N10500"></a>
+<h4>Examples</h4>
+<p>In this example key value pairs are set at the command line.</p>
+<pre class="code">
+grunt&gt; SET debug 'on'
+grunt&gt; SET job.name 'my job'
+grunt&gt; SET default_parallel 100
+</pre>
+<p>In this example default_parallel is set in the Pig script; all MapReduce jobs that get launched will use 20 reducers.</p>
+<pre class="code">
+SET default_parallel 20;
+A = LOAD 'myfile.txt' USING PigStorage() AS (t, u, v);
+B = GROUP A BY t;
+C = FOREACH B GENERATE group, COUNT(A.t) as mycount;
+D = ORDER C BY mycount;
+STORE D INTO 'mysortedcount' USING PigStorage();
+</pre>
+<p>In this example multiple key value pairs are set in the Pig script. These key value pairs are put in job-conf by Pig (making the pairs available to Pig and Hadoop). This is a script-wide setting; if a key value is defined multiple times in the script the last value will take effect and will be set for all jobs generated by the script. </p>
+<pre class="code">
+...
+SET mapred.map.tasks.speculative.execution false; 
+SET pig.logfile mylogfile.log; 
+SET my.arbitrary.key my.arbitary.value; 
+...
+</pre>
+</div>
+
+
+  
+</div>
+<!--+
+    |end content
+    +-->
+<div class="clearboth">&nbsp;</div>
+</div>
+<div id="footer">
+<!--+
+    |start bottomstrip
+    +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<div class="copyright">
+        Copyright &copy;
+         2007-2013 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
+</div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>

Added: pig/site/publish/docs/r0.11.1/cmds.pdf
URL: http://svn.apache.org/viewvc/pig/site/publish/docs/r0.11.1/cmds.pdf?rev=1463367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: pig/site/publish/docs/r0.11.1/cmds.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream