You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by kn...@apache.org on 2016/09/12 18:00:43 UTC

svn commit: r1760422 - in /pig/trunk: CHANGES.txt src/docs/src/documentation/content/xdocs/basic.xml

Author: knoguchi
Date: Mon Sep 12 18:00:43 2016
New Revision: 1760422

URL: http://svn.apache.org/viewvc?rev=1760422&view=rev
Log:
PIG-5027: Improve SAMPLE Scalar Expression Example (icook via knoguchi)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1760422&r1=1760421&r2=1760422&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Mon Sep 12 18:00:43 2016
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
  
 IMPROVEMENTS
 
+PIG-5027: Improve SAMPLE Scalar Expression Example (icook via knoguchi)
+
 PIG-5023: Documentation for BagToTuple (icook via knoguchi)
 
 PIG-5022: Error in TOKENIZE Example (icook vi knoguchi)

Modified: pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml
URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml?rev=1760422&r1=1760421&r2=1760422&view=diff
==============================================================================
--- pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml (original)
+++ pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml Mon Sep 12 18:00:43 2016
@@ -7981,10 +7981,10 @@ X = SAMPLE A 0.01;
 </source>
 <p>In this example, a scalar expression is used (it will sample approximately 1000 records from the input).</p>
 <source>
-a = load 'a.txt';
-b = group a all;
-c = foreach b generate COUNT(a) as num_rows;
-e = sample a 1000/c.num_rows;
+a = LOAD 'a.txt';
+b = GROUP a ALL;
+c = FOREACH b GENERATE COUNT_STAR(a) AS num_rows;
+d = SAMPLE a (double)1000/c.num_rows;
 </source>
    </section></section>