the input is 1000:rohit:male:dev:2500
In this i want to count the male and female count. when i use split, assigning each gender field to reducer shows ArrayIndexOutOfBounfException:2
public class DeptEmpcountMapper extends
Mapper<LongWritable, Text, Text, LongWritable> {
@Override
protected void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException {
String st = value.toString();
String[] field = st.split(":");
String st1 = field[2];
context.write(new Text(st1), new LongWritable(1));
}
}