You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Matt Denn <ma...@yahoo.com> on 2011/12/04 14:26:30 UTC
output to file
I have an array computed in map stage and want its ouptut recorded or sent to file. Reducer can be naive and just send the output to file. Need to get a text output written to file for this array.
Re: output to file
Posted by Harsh J <ha...@cloudera.com>.
Also, you don't need to run a reducer if you do not want one. Set your number of reduce tasks to 0 before launching your job.
On 04-Dec-2011, at 9:03 PM, Praveen Sripati wrote:
>
> Matt,
>
> You can extend ArrayWritable. Also use TextOutputFormat as the output format.
>
> In the TextOutputFormat key.toString() and value.toString() are called, so override toString() in the subclass of ArrayWritable to get the desired output format for the array. If toString() is not overridden then class name and hex of the hash code is written to the output.
>
> Regards,
> Praveen
>
> On Sun, Dec 4, 2011 at 6:56 PM, Matt Denn <ma...@yahoo.com> wrote:
> I have an array computed in map stage and want its ouptut recorded or sent to file. Reducer can be naive and just send the output to file. Need to get a text output written to file for this array.
>
Re: output to file
Posted by Praveen Sripati <pr...@gmail.com>.
Matt,
You can extend ArrayWritable. Also use TextOutputFormat as the output
format.
In the TextOutputFormat key.toString() and value.toString() are called, so
override toString() in the subclass of ArrayWritable to get the desired
output format for the array. If toString() is not overridden then class
name and hex of the hash code is written to the output.
Regards,
Praveen
On Sun, Dec 4, 2011 at 6:56 PM, Matt Denn <ma...@yahoo.com> wrote:
> I have an array computed in map stage and want its ouptut recorded or sent
> to file. Reducer can be naive and just send the output to file. Need to get
> a text output written to file for this array.
>