I think the title is already explaining my question. I would like to change
key (tab space) value
into
key;value
in all output files the reducers are generating from the output of mappers.
I could not find good documentation on this using google. Can anyone please give a fraction of code on how to achieve this?
In lack of better documentation, here's what I've collected:
setTextOutputFormatSeparator(final Job job, final String separator){
final Configuration conf = job.getConfiguration(); //ensure accurate config ref
conf.set("mapred.textoutputformat.separator", separator); //Prior to Hadoop 2 (YARN)
conf.set("mapreduce.textoutputformat.separator", separator); //Hadoop v2+ (YARN)
conf.set("mapreduce.output.textoutputformat.separator", separator);
conf.set("mapreduce.output.key.field.separator", separator);
conf.set("mapred.textoutputformat.separatorText", separator); // ?
}
Set the configuration property mapred.textoutputformat.separator
to ";"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With