Please help debug my program


2 Answer(s)


Hi Patrice,
Error: Type mismatch: Expected InWritable,receiving Text.
If you see your map code,you are using the Text to inherit and distribute the data. You have to use the map for it.
The output is defined as TEXT format.
writer.write(sourceid, offerName);

Hope this helps
Thanks

Hi Patrice,
Here is some sample code for you:

protected void map(LongWritable key, Text value, Context context)
throws java.io.IOException, InterruptedException {


String row = value.toString();
String[] tokens = row.split(",");
String deptId = tokens[2];
String deptName = deptMap.get(deptId);
outputKey.set(deptName);
outputValue.set(row);
context.write(outputKey,outputValue);
}