hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tarandeep Singh" <tarand...@gmail.com>
Subject Re: Sorting output data on value
Date Fri, 22 Feb 2008 01:38:24 GMT
On Thu, Feb 21, 2008 at 5:34 PM, Ted Dunning <tdunning@veoh.com> wrote:
>
>  Use another job step to get the sort done.
>

but isn't the output of reduce step sorted ?
Also can I specify that sort be done in reverse order ?

>
>
>  On 2/21/08 5:11 PM, "Tarandeep Singh" <tarandeep@gmail.com> wrote:
>
>  > On Thu, Feb 21, 2008 at 3:46 PM, Tarandeep Singh <tarandeep@gmail.com> wrote:
>  >> hi,
>  >>
>  >>  Can I sort the output of reducer based on the value instead of key.
>  >>  Also can I specify that the output should be sorted in decreasing order ?
>  >>
>  >>  Mapper output -
>  >>   <aWord, 1>
>  >>
>  >>  Reducer gets-
>  >>   <aWord, (1,1,...)>
>  >>
>  >>  and outputs -
>  >>  <aWord, count>
>  >>
>  >>  e.g abc 10
>  >>       xyz  100
>  >>
>  >>  I want the output to be sorted based on the value and that too in
>  >>  decreasing order -
>  >>      xyz 100
>  >>      abc  10
>  >>
>  >>  Any suggestions ?
>  >>
>  >
>  > I set the output format to Text and then converted the count into text
>  > and wrote this as key and the aWord as value. I was expecting an
>  > output sorted on the count now but it didn't work that way ? Could
>  > anyone explain why so ?
>  >
>  > reducer output -
>  >   <000001, abc>
>  >   <000005, xyz>
>  >   <000002, pqr>
>  >
>  > thanks,
>  > Taran
>  >
>  >
>  >>  thanks,
>  >>  Taran
>  >>
>
>

Mime
View raw message