I have a reducer in hadoop with this code:
public void reduce(Text key, Iterator<Text> values, Context context) throws IOException, InterruptedException {
/*some code*/
String followers = "";
while(values.hasNext()){
followers = followers + values.next().toString() + ",";
}
/*some code*/
}
I want to make a list of followers for a certain node but when I run it I am getting this:
Error: java.lang.ArrayIndexOutOfBoundsException: 1
If values is type Iterable then I don't have a problem but why is this happening?
thanks in advance.