You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by "Palleti, Pallavi" <pa...@corp.aol.com> on 2008/09/29 06:50:31 UTC

Writer class for writing tab separated Text key, value pairs

Hi,

 Can anyone please tell me which class I should use for writing a data
in plain text output format. I can use KeyValueLineRecordReader for
reading a line. But there is no KeyValueLineRecordWriter.

The only possibility that I found is to call getRecordWriter() of
TextOutputFormat. But, the problem here is, I need to implement
Progressable interface inorder to use this. Is there a simple way to do
this?

 

Thanks

Pallavi


Re: Writer class for writing tab separated Text key, value pairs

Posted by Anthony Urso <an...@gmail.com>.
If you are doing this in mapreduce, just set the output format to
TextOutputFormat and collect Texts in your reducer.

Otherwise, just open a file on the HDFS and println(key + "\t" +
value) for each tuple.

On Sun, Sep 28, 2008 at 9:50 PM, Palleti, Pallavi
<pa...@corp.aol.com> wrote:
> Hi,
>
>  Can anyone please tell me which class I should use for writing a data
> in plain text output format. I can use KeyValueLineRecordReader for
> reading a line. But there is no KeyValueLineRecordWriter.
>
> The only possibility that I found is to call getRecordWriter() of
> TextOutputFormat. But, the problem here is, I need to implement
> Progressable interface inorder to use this. Is there a simple way to do
> this?
>
>
>
> Thanks
>
> Pallavi
>
>