Please help debug my program
2 Answer(s)
Abhijit-Dezyre Support
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
Mar 23 2016 05:13 AM
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
Abhijit-Dezyre Support
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);
}
Mar 23 2016 05:14 AM
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);
}