hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From valentina kroshilina <kroshil...@gmail.com>
Subject Re: casting in mapper
Date Mon, 25 Jan 2010 20:15:21 GMT
it's not the mapper, it's the setting

conf.setMapOutputValueClass(IncidentWritable.class);

that throws exception.
so

conf.setMapOutputValueClass(ProviderIncidentWritable.class);

fixes it.




On Fri, Jan 22, 2010 at 2:21 PM, valentina kroshilina
<kroshilina@gmail.com>wrote:

> why can't I do something like this:
>
> public void map(LongWritable longWritable, *ProviderIncidentWritable value
> *, OutputCollector<IntWritable,* IncidentWritable*> outputCollector,
> Reporter reporter) throws IOException
> {
>         outputCollector.collect(new IntWritable(value.getId()), *value*);
> }
>
> where:
>
> *public class ProviderIncidentWritable extends IncidentWritable*
>
> I get error:
>
> java.io.IOException: Type mismatch in value from map: expected writable.IncidentWritable,
recieved writable.ProviderIncidentWritable
>
>
>
> 	at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:812)
> 	at org.apache.hadoop.mapred.MapTask$OldOutputCollector.collect(MapTask.java:466)
> 	at mapper.ProviderAccountNonEmptyPrimaryInsuranceMapper.map(ProviderAccountNonEmptyPrimaryInsuranceMapper.java:31)
>
>
>
> 	at mapper.ProviderAccountNonEmptyPrimaryInsuranceMapper.map(ProviderAccountNonEmptyPrimaryInsuranceMapper.java:25)
> 	at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
> 	at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:358)
>
>
>
> 	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
> 	at org.apache.hadoop.mapred.Child.main(Child.java:170)
>
>
> Is it just me doing something wrong, or is it not possible for some reason?
>
> --
> valentina kroshilina
>



-- 
valentina kroshilina

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