import org.apache.hadoop.mapreduce.lib.output.MultipleOutputs;
reduce端
private MultipleOutputs output;
@Override
protected void setup(Context context
) throws IOException, InterruptedException {
output = new MultipleOutputs(context);
}
private String generateFileName(Text k,String goalpath) {
// if (k.toString().equals("hello"))
return goalpath+"/target";
// return "other";
}
reduce函数内
output.write(oKey, oVal,generateFileName(targetKey,goalpath));
mapreduce使用MultipleOutputs
最新推荐文章于 2024-06-12 17:06:35 发布
