Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Mapper example correction

Mapper example correction

Rising Star

The class org.apache.hadoop.mapreduce.Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

has an example with


public void map(Object key, Text value, Context context)



But, "Any type which is to be used as a key in the Hadoop Map-Reduce framework should implement this interface."<T>


The example has Object for key type. Object doesn't implement WritableComparable.


The example should be modified to make the key type as a class  that implements the WritableComparable interface.


Re: Mapper example correction

Rising Star

 Mapper class

Don't have an account?
Coming from Hortonworks? Activate your account here