매퍼에서 문자열을 값으로 전달하려고 시도했지만 쓰기가 불가능하다는 오류가 발생했습니다. 해결 방법?매퍼에서 문자열을 값으로 전달하는 방법은 무엇입니까?
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
String TempString = value.toString();
String[] SingleRecord = TempString.split("\t");
//using Integer.parseInt to calculate profit
int Amount = Integer.parseInt(SingleRecord[7]);
int Asset = Integer.parseInt(SingleRecord[8]);
int SalesPrice = Integer.parseInt(SingleRecord[9]);
int Profit = Amount*(SalesPrice-Asset);
String ValueProfit = String.valueOf(Profit);
String ValueOne = String.valueOf(one);
custID.set(SingleRecord[2]);
data.set(ValueOne + ValueProfit);
context.write(custID, data);
}
'데이터'란 무엇이며 'custId'는 무엇입니까? –