1
輸入是1000:rohit:male:dev:2500
ArrayIndexOutOfBoundException在映射代碼
在這方面,我要計數的男性和女性的計數。當我使用分割,分配每個性別領域減速器節目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));
}
}
你說的減速機拋出異常,但你已經張貼你的映射器的代碼。 – philantrovert