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 Anuja Kulkarni <an...@yahoo.com> on 2011/10/04 18:48:50 UTC

Can we use Inheritance hierarchy to specify the outputvalue class for mapper which is also inputvalue class for the reducer ?

Hi,

We have class hierarchy for output value for both mapper as well as reducer class   as parent (abstract class) , child1,child2,… 
 
We have mapper class which is 
specified with its outputvalue class as parent class ; the map function 
will emit  either  child1 or child2 depending on the logic we used ( 
and reducer is having its inputvalue class as parent class).
 
But we are getting error as  "java.io.IOException: Type mismatch in value from map: expected parent classreceived child class”
 So is this possible to specify parent class as output/inputvalue class in case of mapper as well as in reducer ; since we want to follow some object-oriented approach. What will be the correct way of achieving this ?


- Anuja