List Info

Thread: about the Class of IntWritable and Text




about the Class of IntWritable and Text
user name
2008-01-15 02:19:13
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: maqiang1984gmail.com

Re: about the Class of IntWritable and Text
country flaguser name
Germany
2008-01-15 04:41:49
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: maqiang1984gmail.com


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )