You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by ma qiang <ma...@gmail.com> on 2008/01/15 09:19:13 UTC
about the Class of IntWritable and Text
Dear colleague,
In the method of output.collect(key, value), I can set the
"value" as Text or IntWritable in the reduce function, but I can only
set it as IntWritable in the map function. Would you tell me why?
when I set the "value" as Text, the system output the error as follows :
java.io.IOException: Type mismatch in value from map: expected
org.apache.hadoop.io.IntWritable, recieved org.apache.hadoop.io.Text
Thanks!
Qiang Ma
Department of Computer Science and Engineering
Fudan University
Shanghai, P. R. China
EMail: maqiang1984@gmail.com
Re: about the Class of IntWritable and Text
Posted by André Martin <ma...@andremartin.de>.
Hi Qiang,
you need to set the type additionally using:
jobConf.setOutputKeyClass(Text.class);
Cu on the 'net,
Bye - bye,
<<<<< André <<<< >>>> èrbnA >>>>>
ma qiang wrote:
> Dear colleague,
> In the method of output.collect(key, value), I can set the
> "value" as Text or IntWritable in the reduce function, but I can only
> set it as IntWritable in the map function. Would you tell me why?
> when I set the "value" as Text, the system output the error as follows :
> java.io.IOException: Type mismatch in value from map: expected
> org.apache.hadoop.io.IntWritable, recieved org.apache.hadoop.io.Text
> Thanks!
>
>
> Qiang Ma
> Department of Computer Science and Engineering
> Fudan University
> Shanghai, P. R. China
> EMail: maqiang1984@gmail.com