如何在hadoop mr作业中更改reducer输出文件名?

如何在hadoop mr作业中更改reducer输出文件名?,hadoop,mapreduce,reducers,multipleoutputs,Hadoop,Mapreduce,Reducers,Multipleoutputs,我有一个reducer脚本,需要生成一堆xml文件。我想使用reducer键以编程方式设置文件名。我使用MultipleOutputs来完成以下任务 MultipleOutputs mos = new MultipleOutputs(context); mos.write(new Text(key), new Text(output), key + ".xml"); 但是输出文件名类似于key.xml-r-00000。如何从文件名中删除-r-*部分,使其成为简单的key.xml?此处-r-00

我有一个reducer脚本,需要生成一堆xml文件。我想使用reducer键以编程方式设置文件名。我使用
MultipleOutputs
来完成以下任务

MultipleOutputs mos = new MultipleOutputs(context);
mos.write(new Text(key), new Text(output), key + ".xml");

但是输出文件名类似于
key.xml-r-00000
。如何从文件名中删除
-r-*
部分,使其成为简单的
key.xml

此处-r-0000表示它是由reducer生成的。我们无法更改它,如果您想要自定义文件名,请在生成这些文件后编写代码以更改文件名