How can we pass List <Text> as Mapper output?
1 answer
You can use the ArrayWritable class as a value object from the mapper class. Please refer to the below code snippet for your mapping class,
ArrayWritable arrayWritable = new ArrayWritable(Text.class);
Text [] textValues = new Text[2];
textValues[0] = new Text("value1");
textValues[1] = new Text("value1");
arrayWritable.set(textValues );
context.write(key , arrayWritable );
set the value class as the following in your driver class,
job.setMapOutputValueClass(ArrayWritable.class);
+4
source to share