Yes, We can change it using "mapred.textoutputformat.separator" property in Driver class, if we are using TextOutputFormat as Output Format.Default seperator is "\t".
Change to ","
Configuration conf = getConf();
conf.set("mapred.textoutputformat.separator", ",");
Change to ";"
Configuration conf = getConf();
conf.set("mapred.textoutputformat.separator", ";");
Change to ":"
Configuration conf = getConf();
conf.set("mapred.textoutputformat.separator", ":");
Happy Hadooping ...
Hi,
ReplyDeleteI dont want any seperator between the key value in the output. How to achieve it?
I have provided as below..
Deleteconf.set("mapred.textoutputformat.separator", "");
But it is giving me tab seperated key/value pairs
If you dont want seperator you can emit your result as just key or value.
Deletefor example: String key = "hai";
String value = "Hello";
context.write(new Text(key),new Text(value))---->gives seperator
so inorder to avoid that you can pass it as just value
context.write(NullWritable.get(),new Text(key.concat(value)));