You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Ramasubramanian Narayanan <ra...@gmail.com> on 2012/11/07 13:39:01 UTC

Doubt on Input and Output Mapper - Key value pairs

Hi,

Which of the following is correct w.r.t mapper.

(a) It accepts a single key-value pair as input and can emit any number of
key-value pairs as output, including zero.
(b) It accepts a single key-value pair as input and emits a single key and
list of corresponding values as output


regards,
Rams

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Harsh J <ha...@cloudera.com>.
The answer (a) is correct, in general.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams



-- 
Harsh J

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Harsh J <ha...@cloudera.com>.
The answer (a) is correct, in general.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams



-- 
Harsh J

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Mahesh Balija <ba...@gmail.com>.
Hi Rams,

           A mapper will accept single key-value pair as input and can emit
0 or more key-value pairs based on what you want to do in mapper function
(I mean based on your business logic in mapper function).
           But the framework will actually aggregate the list of values
associated with a given key and sends the key and List of values to the
reducer function.

Best,
Mahesh Balija.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan <
ramasubramanian.narayanan@gmail.com> wrote:

> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams
>

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Mahesh Balija <ba...@gmail.com>.
Hi Rams,

           A mapper will accept single key-value pair as input and can emit
0 or more key-value pairs based on what you want to do in mapper function
(I mean based on your business logic in mapper function).
           But the framework will actually aggregate the list of values
associated with a given key and sends the key and List of values to the
reducer function.

Best,
Mahesh Balija.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan <
ramasubramanian.narayanan@gmail.com> wrote:

> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams
>

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Mahesh Balija <ba...@gmail.com>.
Hi Rams,

           A mapper will accept single key-value pair as input and can emit
0 or more key-value pairs based on what you want to do in mapper function
(I mean based on your business logic in mapper function).
           But the framework will actually aggregate the list of values
associated with a given key and sends the key and List of values to the
reducer function.

Best,
Mahesh Balija.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan <
ramasubramanian.narayanan@gmail.com> wrote:

> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams
>

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Mahesh Balija <ba...@gmail.com>.
Hi Rams,

           A mapper will accept single key-value pair as input and can emit
0 or more key-value pairs based on what you want to do in mapper function
(I mean based on your business logic in mapper function).
           But the framework will actually aggregate the list of values
associated with a given key and sends the key and List of values to the
reducer function.

Best,
Mahesh Balija.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan <
ramasubramanian.narayanan@gmail.com> wrote:

> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams
>

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Harsh J <ha...@cloudera.com>.
The answer (a) is correct, in general.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams



-- 
Harsh J

Re: Doubt on Input and Output Mapper - Key value pairs

Posted by Harsh J <ha...@cloudera.com>.
The answer (a) is correct, in general.

On Wed, Nov 7, 2012 at 6:09 PM, Ramasubramanian Narayanan
<ra...@gmail.com> wrote:
> Hi,
>
> Which of the following is correct w.r.t mapper.
>
> (a) It accepts a single key-value pair as input and can emit any number of
> key-value pairs as output, including zero.
> (b) It accepts a single key-value pair as input and emits a single key and
> list of corresponding values as output
>
>
> regards,
> Rams



-- 
Harsh J