title: pig latin - not showing the right record numbers
body: <p>I have written a <code>pig script</code> for <code>wordcount</code> which works fine. I could see the results from pig script in my output directory in hdfs. But towards the end of my console, I see the following:</p>
  
  <pre><code>Success!
  
  Job Stats (time in seconds):
  JobId   Maps    Reduces MaxMapTime  MinMapTIme  AvgMapTime  MedianMapTime   MaxReduceTime   MinReduceTime   AvgReduceTime   MedianReducetime    Alias   Feature Outputs
  job_local1695568121_0002    1   1   0   0   0   0   0   0   0   0   words_sorted    SAMPLER 
  job_local2103470491_0003    1   1   0   0   0   0   0   0   0   0   words_sorted    ORDER_BY    /output/result_pig,
  job_local696057848_0001 1   1   0   0   0   0   0   0   0   0   book,words,words_agg,words_grouped  GROUP_BY,COMBINER   
  
  Input(s):
  Successfully read 0 records from: "/data/pg5000.txt"
  
  Output(s):
  Successfully stored 0 records in: "/output/result_pig"
  
  Counters:
  Total records written : 0
  Total bytes written : 0
  Spillable Memory Manager spill count : 0
  Total bags proactively spilled: 0
  Total records proactively spilled: 0
  
  Job DAG:
  job_local696057848_0001 -&gt;  job_local1695568121_0002,
  job_local1695568121_0002    -&gt;  job_local2103470491_0003,
  job_local2103470491_0003
  
  
  2014-07-01 14:10:35,241 [main] INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Success!
  </code></pre>
  
  <p>As you can see, the job is success. but not the <code>Input(s)</code> and <code>output(s)</code>. Both of the them say <code>successfully read/stored 0 records</code> and the counter values are all 0.
  why the value is zero. These should not be zero.</p>
  
  <p>I am using <code>hadoop2.2 and pig-0.12</code></p>
  
  <p>Here is the script:</p>
  
  <pre><code>book = load '/data/pg5000.txt' using PigStorage() as (lines:chararray);
  words = foreach book generate FLATTEN(TOKENIZE(lines)) as word;
  words_grouped = group words by word;
  words_agg = foreach words_grouped generate group as word, COUNT(words);
  words_sorted = ORDER words_agg BY $1 DESC;
  STORE words_sorted into '/output/result_pig' using PigStorage(':','-schema');
  </code></pre>
  
  <p>NOTE: my data is present in <code>/data/pg5000.txt</code> and not in default directory which is <code>/usr/name/data/pg5000.txt</code></p>
  
  <p>EDIT: here is the output of printing my file to console</p>
  
  <pre><code>hadoop fs -cat /data/pg5000.txt | head -10
  The Project Gutenberg EBook of The Notebooks of Leonardo Da Vinci, Complete
  by Leonardo Da Vinci
  (#3 in our series by Leonardo Da Vinci)
  
  Copyright laws are changing all over the world. Be sure to check the
  copyright laws for your country before downloading or redistributing
  this or any other Project Gutenberg eBook.
  
  This header should be the first thing seen when viewing this Project
  Gutenberg file.  Please do not remove it.  Do not change or edit the
  cat: Unable to write to output stream.
  </code></pre>