hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Voigt...@123.org>
Subject Re: Sorting Values sent to reducer NOT based on KEY (Depending on part of VALUE)
Date Tue, 23 Apr 2013 05:54:17 GMT
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 <vikascjadhav87@gmail.com>:

> 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
k@123.org





Mime
View raw message