title: Use PIG to count the number of records in an avro file
body: <p>I can open a avro file in HUE and HUE shows me it has 10 records. i can browse through all the 10 records in HUE.</p>
  
  <p>Now I write the following code in PIG</p>
  
  <pre><code>data = LOAD '/user/admin/2015/10/04/02/file1.avro' USING AvroStorage();
  data_group = GROUP data ALL;
  row_count = FOREACH data_group GENERATE COUNT(data);
  dump row_count;
  </code></pre>
  
  <p>The output of the job is </p>
  
  <pre><code>Input(s):
  Successfully read 4 records (58507 bytes) from: "/user/admin/2015/10/04/02/file1.avro"
  
  Output(s):
  Successfully stored 1 records (6 bytes) in: "hdfs://nn1/tmp/temp-268177355/tmp915757783"
  
  Counters:
  Total records written : 1
  Total bytes written : 6
  Spillable Memory Manager spill count : 0
  Total bags proactively spilled: 0
  Total records proactively spilled: 0
  
  Job DAG:
  job_1438959478020_940907
  
  
  2015-10-29 19:08:55,252 [main] INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Success!
  2015-10-29 19:08:55,252 [main] INFO  org.apache.hadoop.conf.Configuration.deprecation - fs.default.name is deprecated. Instead, use fs.defaultFS
  2015-10-29 19:08:55,253 [main] INFO  org.apache.pig.data.SchemaTupleBackend - Key [pig.schematuple] was not set... will not generate code.
  2015-10-29 19:08:55,261 [main] INFO  org.apache.hadoop.mapreduce.lib.input.FileInputFormat - Total input paths to process : 1
  2015-10-29 19:08:55,261 [main] INFO  org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total input paths to process : 1
  (4)
  </code></pre>
  
  <p>How did 10 become 4. Is there a different way to count the number of records in an avro file using PIG?</p>