How to use MultipleOutputs format to generate custom file name with generating other files

84 Views Asked by At

I am writing Orc files using MultipleOutputs format to create a custom file name. I am setting the Driver as below

MultipleOutputs.addNamedOutput(job, "MyPrefix", OrcNewOutputFormat.class, NullWritable.class, Writable.class);

In Reducer as below

setup:

_multipleOutputs = new MultipleOutputs<NullWritable, Writable>(context);

Reduce method:

_multipleOutputs.write("MyPrefix", NullWritable.get(), row);

cleanup method:

_multipleOutputs.close();

Though for files having data it generates with prefix "MyPrefix", but is also generating part-00000 file having no record.

Please let me know how can I stop reducer generating this empty file with name part-00000.

0

There are 0 best solutions below