hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arindam Khaled <akha...@utdallas.edu>
Subject wrong value class error
Date Tue, 16 Nov 2010 00:05:58 GMT
Hello,

I am new to Hadoop and I think I'm doing something silly. I sent this  
e-mail from another account which isn't registered to hadoop user group.

I am getting the following error in my reducer.

10/11/15 15:29:11 WARN mapred.LocalJobRunner: job_local_0001
java.io.IOException: wrong value class: class  
org.apache.hadoop.io.Text is not class org.apache.hadoop.io.IntWritable

Here is my reduce class:

  public static class BFIDAReducer
        extends Reducer<Text,IntWritable,Text,Text> {
     private Text result = new Text();

     public void reduce(Text key, Iterable<IntWritable> values,
                        Context context
                        ) throws IOException, InterruptedException {
       Text result = new Text();
       GameFunctions gf = GameFunctions.getInstance();


       String line = "";

       for(IntWritable val: values)
         {
             line = line + val.toString() + ",";
         }

         if(line.length() > 1)
             line = (String) line.subSequence(0, line.length() - 1);

     if (gf.isSolved(key.toString(), size))
             solved = true;

       result.set(line);
       context.write(key, result);
     }
   }

And here is my partial code from job configuration:

     job.setOutputKeyClass(Text.class);
     job.setOutputValueClass(Text.class);
     job.setMapOutputKeyClass(Text.class);
     job.setMapOutputValueClass(IntWritable.class);

Can anyone help me?



I know I'll have more question in near future.

Thanks in advance.

Arindam






Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message