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 Asim <li...@gmail.com> on 2009/05/13 22:57:59 UTC

Selective output based on keys

Hi,

I wish to output only selective records to the output files based on
keys. Is it possible to selectively write keys by setting
setOutputKeyClass. Kindly let me know.

Regards,
Asim

Re: Selective output based on keys

Posted by jason hadoop <ja...@gmail.com>.
The customary practice is to have your Reducer.reduce method handle the
filtering if you are reducing your output.
or the Mapper.map method if you are not.

On Wed, May 13, 2009 at 1:57 PM, Asim <li...@gmail.com> wrote:

> Hi,
>
> I wish to output only selective records to the output files based on
> keys. Is it possible to selectively write keys by setting
> setOutputKeyClass. Kindly let me know.
>
> Regards,
> Asim
>



-- 
Alpha Chapters of my book on Hadoop are available
http://www.apress.com/book/view/9781430219422
www.prohadoopbook.com a community for Hadoop Professionals

Re: Selective output based on keys

Posted by sharad agarwal <sh...@yahoo-inc.com>.
setOutputKeyClass let you specify the output key type.
For outputting selective keys, you need to call OutputCollector#collect
for only those keys. If using new map reduce API, need to call 
Context#write.

- Sharad

Asim wrote:
>
> Hi,
>
> I wish to output only selective records to the output files based on
> keys. Is it possible to selectively write keys by setting
> setOutputKeyClass. Kindly let me know.
>
> Regards,
> Asim
>