You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Owen O'Malley <om...@apache.org> on 2010/02/02 17:18:20 UTC

Re: Does the class of the Mapper output need to match the exact class of the specified output?

On Jan 26, 2010, at 5:17 PM, Wilkes, Chris wrote:

> Does this level of checking really need to be done?

For Writables, the simple answer is yes. It happens because the way  
you deserialize is to:

Writable obj = ReflectionUtils.newInstance(cls, conf);
obj.readFields(in);

So you need to know the specific class to read into. To support this  
use case, there is library code available in Hadoop:

http://bit.ly/9UoZGc

There is work underway to loosen the restriction in trunk, but that is  
a long ways from being released.

-- Owen