hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thamizhannal Paramasivam <thamizhanna...@gmail.com>
Subject Set<IntWritable> on reducer issue
Date Wed, 08 May 2013 15:10:05 GMT
Hi,
I require clarification on using IntWritable in Set type in Java.
Below is my sample code. When I execute reducer with E.x. key="abcd"
values=12,3,4, then categorySet have any one value from values.

My hadoop version is 0.20.2. Any help would be appreciated.

        public void reduce(Text key, Iterable<IntWritable> values,
                Context context) throws IOException, InterruptedException {

             Set<IntWritable> categorySet = new TreeSet<IntWritable>();
             for (IntWritable val : values) {
                 categorySet.add(val);
             }
            ----------------
            ----------------
    }

Thanks,
Thamizh

Mime
View raw message