在MultipleOutputs中-避免将我的密钥写入文件中



Hi-im使用Hadoop mapreduce,im使用multipleoutput。下面是我的代码

mos = new MultipleOutputs(context);
mos.write(key, value, propertyName.trim());

但它生成了后缀为-m-0000的多个文件。我该如何消除它?

而且我不想在文件中打印我的钥匙。那么,我该如何避免我的密钥被写入文件中呢。?

研究使用LazyOutputFormat-如果没有通过context.write:写入任何内容,它将不会创建默认的输出文件

job.setOutputFormat(LazyOutputFormat.class);
// This can be any file based output format
LazyOutputFormat.setOutputFormatClass(TextOutputFormat.class);

最新更新