You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Tarandeep Singh <ta...@gmail.com> on 2008/05/29 18:51:41 UTC
Anyone to help me on MapWritable as Intermediate Key
Hi,
I want to use MapWritable or SortedMapWritable as intermediate key emitted
by Map functions. I want to know how the framework is going to sort and
group such keys. Also how can I provide my own comparator so that the
framework sorts and groups according to my requirement.
thanks a lot,
Taran
On Wed, May 28, 2008 at 4:39 PM, Tarandeep Singh <ta...@gmail.com>
wrote:
> Hi,
>
> Can someone point me to an example code where MapWritable/SortedMapWritable
> is used as in intermediate key. I am looking for how to set the comparator
> for MapWritable/SortedMapwritable so that the framework groups/sorts the
> intermediate keys in accordance to my requirement - sort the intermediate
> Keys (MapWritable objects) based on concatenated value of values in the
> MapWritable object.
>
> Thanks,
> Taran
>
Re: Anyone to help me on MapWritable as Intermediate Key
Posted by Tamer Elsayed <te...@gmail.com>.
Hi Tarandeep,
MapWritable doesn't implement Comparable, so I think it cannot be used as a
key. If u want that functionality, then u have to have a subclass that
implements Comparable and there u will define your sorting logic.
Tamer
On Thu, May 29, 2008 at 12:51 PM, Tarandeep Singh <ta...@gmail.com>
wrote:
> Hi,
>
> I want to use MapWritable or SortedMapWritable as intermediate key emitted
> by Map functions. I want to know how the framework is going to sort and
> group such keys. Also how can I provide my own comparator so that the
> framework sorts and groups according to my requirement.
>
> thanks a lot,
> Taran
>
> On Wed, May 28, 2008 at 4:39 PM, Tarandeep Singh <ta...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Can someone point me to an example code where
> MapWritable/SortedMapWritable
> > is used as in intermediate key. I am looking for how to set the
> comparator
> > for MapWritable/SortedMapwritable so that the framework groups/sorts the
> > intermediate keys in accordance to my requirement - sort the intermediate
> > Keys (MapWritable objects) based on concatenated value of values in the
> > MapWritable object.
> >
> > Thanks,
> > Taran
> >
>
--
Proud to be a follower of the "Best of Mankind"
"وَاذْكُرْ رَبَّكَ إِذَا نَسِيتَ وَقُلْ عَسَى أَنْ يَهْدِيَنِي رَبِّي
لأقْرَبَ مِنْ هَذَا رَشَدًا"