Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
MapReduce, mail # user - Sorting Values sent to reducer NOT based on KEY (Depending on part of VALUE)


+
Vikas Jadhav 2013-04-23, 05:44
Copy link to this message
-
Re: Sorting Values sent to reducer NOT based on KEY (Depending on part of VALUE)
Kai Voigt 2013-04-23, 05:54
Hello,

the design pattern here is to emit the component you want to sort by (second field of your value in your case) as the key in the map phase.

If you also want to keep the sorting by the original key, you need to emit a composite key, consisting of your original key and that part of the value. This technique is called the secondary sort.

Kai

Am 23.04.2013 um 07:44 schrieb Vikas Jadhav <[EMAIL PROTECTED]>:

> Hi
>  
> how to sort value in hadoop using standard sorting algorithm of hadoop ( i.e sorting facility provided by hadoop)
>  
> Requirement:
>  
> 1) Values shoulde be sorted depending on some part of value
>  
> For Exam     (KEY,VALUE)
>  
>  (0,"BC,4,XY')
>  (1,"DC,1,PQ")
>  (2,"EF,0,MN")
>  
> Sorted sequence @ reduce reached should be
>  
> (2,"EF,0,MN")
> (1,"DC,1,PQ")
> (0,"BC,4,XY')
>  
> Here sorted depending on second attribute postion in value.
>  
> Thanks
>  
>
>
> --
>
>   Regards,
>    Vikas

--
Kai Voigt
[EMAIL PROTECTED]
+
Sofia Georgiakaki 2013-04-23, 07:45