hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khanh Nguyen" <kngu...@cs.umb.edu>
Subject Re: type mismatch from key to map
Date Mon, 21 Jul 2008 18:31:48 GMT
Nevermind, I figured out my problem. I did not configure OutputFormat.

On Mon, Jul 21, 2008 at 1:44 PM, Khanh Nguyen <knguyen@cs.umb.edu> wrote:
> Hi Daniel,
>
> The outputformat of my 1st hadoop job is TextOutputFormat. The
> skeleton of my code follows:
>
> public int run(String[] args) throws Exception {
> //set up and run job 1
> ...
>                conf.setOutputFormat(TextOutputFormat.class);
>                FileOutputFormat.setOutputPath(conf, new Path(args[1]));
>
> ....
> //set up and run job 2
> .......
>              FileInputFormat.addInputPath(sortJob, new Path(args[1] +
> "/part-00000"));
>              FileOutputFormat.setOutputPath(sortJob, new Path(args[1]
> + "/result/"));
>              sortJob.setInputFormat(KeyValueTextInputFormat.class);
>              sortJob.setMapperClass(InverseMapper.class)
> ......
>
> }
>
> Please help.
>
> -k
>
> On Mon, Jul 21, 2008 at 1:30 PM, Daniel Yu <d4nielfree@gmail.com> wrote:
>> hi k,
>>  i think u should look at ur map output format setting, and check if that
>> fits ur reduce input .
>>
>> Daniel
>>
>> 2008/7/21 Khanh Nguyen <knguyen@cs.umb.edu>:
>>
>>> Hello,
>>>
>>> I am getting this error
>>>
>>> java.io.IOException: Type mismatch in key from map: expected
>>> org.apache.hadoop.io.LongWritable, recieved org.apache.hadoop.io.Text
>>>
>>>
>>> Could someone please explain to me what i am doing wrong. Follow is
>>> the code I think is responsible...
>>>
>>> public int run() {
>>> .....
>>>
>>> sortJob.setInputFormat(KeyValueTextInputFormat.class);
>>>
>>> sortJob.setMapperClass(InverseMapper.class);
>>> ....
>>>
>>> }
>>>
>>> Thanks
>>>
>>> -k
>>>
>>
>

Mime
View raw message