hadoop - How can we pass List<Text> as Mapper output? -
i working on problem of map-reduce. stuck @ 1 point how can pass list<text>
mapper output
? possible or not? if yes, how can tell configuration
mapper output class
?
you may use arraywritable class value object mapper class. please refer below code snippet mapper 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 value class following in driver class,
job.setmapoutputvalueclass(arraywritable.class);
Comments
Post a Comment