If you have a custom key GroupComparator defined for your MR job then you can set it in your hadoop config file as
<property>
<name>mapred.output.value.groupfn.class</name>
<value>com.amandoon.CustomKey.MyGroupComparator</value>
</property>
OR you can set it for a job using the Job object
jobObject.setGroupingComparatorClass(MyGroupComparator.class)
See hadoop example that uses Custom Key GroupComparator
http://hadoop-blog.blogspot.com/2012/04/hadoop-example-using-custom-java-class.html
<property>
<name>mapred.output.value.groupfn.class</name>
<value>com.amandoon.CustomKey.MyGroupComparator</value>
</property>
OR you can set it for a job using the Job object
jobObject.setGroupingComparatorClass(MyGroupComparator.class)
See hadoop example that uses Custom Key GroupComparator
http://hadoop-blog.blogspot.com/2012/04/hadoop-example-using-custom-java-class.html
Valuable information thanks for sharing from Manasa
ReplyDelete