Getting compilation error "Can only iterate over an array or an instance of java.lang.Iterable" at for loop in reducer.
public void reduce(Text key, Iterator<IntWritable> values,
OutputCollector<Text, IntWritable> Output, Reporter arg3)
throws IOException {
// TODO Auto-generated method stub
int sum = 0;
for (IntWritable val : values) {
sum += val.get();
In above code, getting compilation error "Can only iterate over an array or an instance of java.lang.Iterable" at "for (IntWritable val : values)"
. How to use loop in the same?