title: Reducer is getting skipped and yields only Mapper Result
body: <p>I have seen some related posts, but in my case all the thing is fine but , while i am running my Map reduce job, The Reducer part is getting Skipped.I am struggling a lot to get rid of this problem. Any one please figure out the problem and help in getting the job to run.</p>
  
  <h1>Map Task:</h1>
  
  <pre><code>package org.netflix.rating;
  
  import java.io.IOException;
  import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  import org.apache.hadoop.io.IntWritable;
  import org.apache.hadoop.io.LongWritable;
  import org.apache.hadoop.io.Text;
  import org.apache.hadoop.mapreduce.Mapper;
  
  
  public class NetflixAvgRatingMap extends Mapper&lt;LongWritable,Text,LongWritable,IntWritable&gt;{
  
      public void map(LongWritable key,Text value,Context context){
          String NetflixEntrypattern="^(\\s*)([0-9]+)(\\s+)([0-9]+)(\\s+)(\\d{1})(\\s+)(.*)";
          Pattern p = Pattern.compile(NetflixEntrypattern);
          Matcher matcher = p.matcher(value.toString());
          if (!matcher.matches()) {
              return;
      }
      Long movie_id=Long.parseLong(matcher.group(4));
      int rating=Integer.parseInt(matcher.group(6));
      try {
          context.write(new LongWritable(movie_id),new IntWritable(rating));
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      }
  
  }
  </code></pre>
  
  <h1>Reduce Task:</h1>
  
  <pre><code>package org.netflix.rating;
  
  import java.io.IOException;
  import java.util.Iterator;
  
  import org.apache.hadoop.io.FloatWritable;
  import org.apache.hadoop.io.IntWritable;
  import org.apache.hadoop.io.LongWritable;
  import org.apache.hadoop.mapreduce.Reducer;
  
  
  
  public class NetflixAvgRatingReducer extends Reducer&lt;LongWritable,IntWritable,LongWritable,FloatWritable&gt; {
            public void reduce(LongWritable key,Iterable&lt;IntWritable&gt; values,Context context) throws IOException, InterruptedException{
                int sum=0,count=0;
                  while(values.iterator().hasNext()){
                  sum+=values.iterator().next().get();
                  count++;
                }
                float avg=(float)sum/count;
  
                  context.write(key,new FloatWritable(avg));
  
                }
  
            }
  </code></pre>
  
  <h1>Driver Class:</h1>
  
  <pre><code>package org.netflix.rating;
  
  
  import org.apache.hadoop.conf.Configuration;
  import org.apache.hadoop.fs.Path;
  import org.apache.hadoop.io.FloatWritable;
  import org.apache.hadoop.io.IntWritable;
  import org.apache.hadoop.io.LongWritable;
  import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
  import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
  import org.apache.hadoop.mapreduce.Job;
  
  
  public class NetflixAvgRating {
  
      public static void main(String[] args) throws Exception {
  
  
          Configuration conf = new Configuration();
  
          // Create job
          Job job = new Job(conf, "NetflixAvgRating");
          job.setJarByClass(NetflixAvgRating.class);
  
          // Setup MapReduce job
          job.setMapperClass(NetflixAvgRatingMap.class);
          job.setReducerClass(NetflixAvgRatingReducer.class);
  
  
          job.setOutputKeyClass(LongWritable.class);
          job.setOutputValueClass(FloatWritable.class);
          job.setMapOutputKeyClass(LongWritable.class);
          job.setMapOutputValueClass(IntWritable.class);
  
          // Input
          FileInputFormat.addInputPath(job, new Path(args[0]));
          //job.setInputFormatClass(TextInputFormat.class);
  
          // Output
          FileOutputFormat.setOutputPath(job, new Path(args[1]));
          //job.setOutputFormatClass(TextOutputFormat.class);
  
          // Execute job
          int code = job.waitForCompletion(true) ? 0 : 1;
          System.exit(code);
      }
  }
  </code></pre>
  
  <p>I have set all the Configuration and arguments correctly, but My Reduce Task is not getting Executed any More. Any Suggestions would be appreciated.</p>