hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Cordioli <cordioli.albe...@gmail.com>
Subject GroupingComparator
Date Mon, 15 Oct 2012 19:11:27 GMT
Hi all,

a very strange thing is happening with my hadoop program.
My map simply emits tuples with a custom object as key (which
implement WritableComparable).
The object is made of 2 fields, and I implement my partitioner and
groupingclass in such a way that only the first field is taken into
The second field is just a tag and could be 1 or 2.

This is the reducer's snippet:

tag = key.getSecondField();
Iterator it1 = values.iterator();
        collector.emit(new Text("dummy"), tag);

I would expect in my output all the lines with:
dummy       1
dummy       1

but actually the value of tag changes in time and I obtain this type of output:

dummy    1
dummy    1
dummy    2
dummy    2

Someone could explain me way, please?


Alberto Cordioli

View raw message