pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From knogu...@apache.org
Subject svn commit: r1759504 - in /pig/trunk: CHANGES.txt src/docs/src/documentation/content/xdocs/func.xml src/docs/src/documentation/content/xdocs/pig-index.xml
Date Tue, 06 Sep 2016 20:43:47 GMT
Author: knoguchi
Date: Tue Sep  6 20:43:47 2016
New Revision: 1759504

URL: http://svn.apache.org/viewvc?rev=1759504&view=rev
Log:
PIG-5023: Documentation for BagToTuple (icook via knoguchi)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/docs/src/documentation/content/xdocs/func.xml
    pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1759504&r1=1759503&r2=1759504&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Tue Sep  6 20:43:47 2016
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
  
 IMPROVEMENTS
 
+PIG-5023: Documentation for BagToTuple (icook via knoguchi)
+
 PIG-5022: Error in TOKENIZE Example (icook vi knoguchi)
 
 PIG-4931: Document IN operator (dbist13 vi daijy)

Modified: pig/trunk/src/docs/src/documentation/content/xdocs/func.xml
URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/func.xml?rev=1759504&r1=1759503&r2=1759504&view=diff
==============================================================================
--- pig/trunk/src/docs/src/documentation/content/xdocs/func.xml (original)
+++ pig/trunk/src/docs/src/documentation/content/xdocs/func.xml Tue Sep  6 20:43:47 2016
@@ -294,6 +294,75 @@ team_parkyearslist = FOREACH (GROUP team
   </section>
 </section>
 
+<section id="bagtotuple">
+  <title>BagToTuple</title>
+  <p>Un-nests the elements of a bag into a tuple.</p>
+
+  <section>
+    <title>Syntax</title>
+    <table>
+      <tr>
+        <td>
+          <p>BagToTuple(expression)</p>
+        </td>
+      </tr>
+  </table></section>
+
+  <section>
+    <title>Terms</title>
+    <table>
+      <tr>
+        <td>
+         <p>expression</p>
+        </td>
+        <td>
+         <p>An expression with data type bag.</p>
+        </td>
+      </tr> 
+    </table>
+  </section>
+
+  <section>
+    <title>Usage</title>
+    <p>BagToTuple creates a tuple from the elements of a bag. It removes only
+      the first level of nesting; it does not recursively un-nest nested bags.
+      Unlike FLATTEN, BagToTuple will not generate multiple output records per
+      input record.
+    </p>
+  </section>
+  <section>
+    <title>Examples</title>
+    <p>In this example, a bag containing tuples with one field is converted to a tuple.</p>
+<source>
+A = LOAD 'bag_data' AS (B1:bag{T1:tuple(f1:chararray)});
+
+DUMP A;
+({('a'),('b'),('c')})
+({('d'),('e'),('f')})
+
+X = FOREACH A GENERATE BagToTuple(B1);
+
+DUMP X;
+(('a','b','c'))
+(('d','e','f'))
+</source>
+    <p>In this example, a bag containing tuples with two fields is converted to a tuple.</p>
+<source>
+A = LOAD 'bag_data' AS (B1:bag{T1:tuple(f1:int,f2:int)});
+
+DUMP A;
+({(4,1),(7,8),(4,9)})
+({(5,8),(4,3),(3,8)})
+
+X = FOREACH A GENERATE BagToTuple(B1);
+
+DUMP X;
+((4,1,7,8,4,9))
+((5,8,4,3,3,8))
+</source>
+  </section>
+</section>
+
 <section id="bloom">
   <title>Bloom</title>
   <p>Bloom filters are a common way to select a limited set of records before

Modified: pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml
URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml?rev=1759504&r1=1759503&r2=1759504&view=diff
==============================================================================
--- pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml (original)
+++ pig/trunk/src/docs/src/documentation/content/xdocs/pig-index.xml Tue Sep  6 20:43:47 2016
@@ -137,12 +137,15 @@
 <br></br>&nbsp;&nbsp;&nbsp; <a href="func.html#tobag">and TOBAG
function</a>
 <br></br>&nbsp;&nbsp;&nbsp; <a href="basic.html#type-construction">and
type construction operators</a>
 <br></br>&nbsp;&nbsp;&nbsp; <a href="func.html#bagtostring">converting
to string</a>
+<br></br>&nbsp;&nbsp;&nbsp; <a href="func.html#bagtotuple">converting
to tuple</a>
 <br></br>&nbsp;&nbsp;&nbsp; <a href="basic.html#schema-multi">schemas
for multiple types</a>
 <br></br>&nbsp;&nbsp;&nbsp; <a href="basic.html#bag">syntax</a>
 </p>
 
 <p><a href="func.html#bagtostring">BagToString</a> function</p>
 
+<p><a href="func.html#bagtotuple">BagToTuple</a> function</p>
+
 <p><a href="start.html#batch-mode">batch mode</a>. <em>See also</em>
memory management</p>
 
 <p><a href="basic.html#arithmetic">bincond operator</a> ( ?: )</p>



Mime
View raw message