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 Aravinth Bheemaraj <b....@gmail.com> on 2010/11/24 08:52:23 UTC

ArrayWritable as Map/Reduce output value

Hi,

I am a beginner to Hadoop. Can anyone suggest me how to define Map/Reduce
output value as an ArrayWritable?

The output value must contain array of integers.
eg. (img1 , value[] { x-coord, y-coord, R, G, B})

How can the individual fields of the ArrayWritable can be accessed using the
Iterator in the Reduce function? And also how to write the ArrayWritable
object to the output file?

-- 
Aravinth Bheemaraj
University of Florida




-- 
Aravinth Bheemaraj
University of Florida

Re: ArrayWritable as Map/Reduce output value

Posted by Ken <ke...@gmail.com>.
Just create an array of intwritables, the wrap them in arraywritable. Your reducer will get values as arraywritable, which can be unpacked back to the original array. The you can iterate over that array. 

Sent from my iPad

On Nov 23, 2010, at 11:52 PM, Aravinth Bheemaraj <b....@gmail.com> wrote:

> Hi,
> 
> I am a beginner to Hadoop. Can anyone suggest me how to define Map/Reduce
> output value as an ArrayWritable?
> 
> The output value must contain array of integers.
> eg. (img1 , value[] { x-coord, y-coord, R, G, B})
> 
> How can the individual fields of the ArrayWritable can be accessed using the
> Iterator in the Reduce function? And also how to write the ArrayWritable
> object to the output file?
> 
> -- 
> Aravinth Bheemaraj
> University of Florida
> 
> 
> 
> 
> -- 
> Aravinth Bheemaraj
> University of Florida