Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A1638126 for ; Thu, 15 Sep 2011 05:16:58 +0000 (UTC) Received: (qmail 40416 invoked by uid 500); 15 Sep 2011 05:16:57 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 40342 invoked by uid 500); 15 Sep 2011 05:16:56 -0000 Mailing-List: contact mapreduce-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-user@hadoop.apache.org Delivered-To: mailing list mapreduce-user@hadoop.apache.org Received: (qmail 40332 invoked by uid 99); 15 Sep 2011 05:16:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2011 05:16:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of arkoprovomukherjee@gmail.com designates 209.85.210.46 as permitted sender) Received: from [209.85.210.46] (HELO mail-pz0-f46.google.com) (209.85.210.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2011 05:16:48 +0000 Received: by pzk32 with SMTP id 32so635742pzk.5 for ; Wed, 14 Sep 2011 22:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=uCHZELXPbobbEHXJhDJ6G5JHpsYSPTZJIfNUiyiryu8=; b=Li771TQZbkCKw6WqKmDpI12MWrMBhzEjXNcpuZieEMrfEghHLk9aPKxwPPAPDregZ6 hosFZnAxUbk+SRboon8V6aziNL/oHZcarFri1Rl/PpO+dErBKr+riCtJ3mLt7AQdOB7v ihlfyy7yrWNcIOMzy8PMePUZ815kazVt2WjCo= MIME-Version: 1.0 Received: by 10.68.35.4 with SMTP id d4mr164075pbj.499.1316063787077; Wed, 14 Sep 2011 22:16:27 -0700 (PDT) Received: by 10.68.62.6 with HTTP; Wed, 14 Sep 2011 22:16:27 -0700 (PDT) In-Reply-To: <1434815366-1316059971-cardhu_decombobulator_blackberry.rim.net-865410973-@b13.c2.bise7.blackberry> References: <431179662-1316059753-cardhu_blackberry.rim.net-copy_sent_folder-956247297-@b13.c2.bise7.blackberry> <1434815366-1316059971-cardhu_decombobulator_blackberry.rim.net-865410973-@b13.c2.bise7.blackberry> Date: Thu, 15 Sep 2011 00:16:27 -0500 Message-ID: Subject: Re: Reducers without output files From: Arko Provo Mukherjee To: mapreduce-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hello, Many thanks for your reply! So to clarify, I should do the following: public static class Reduce extends MapReduceBase implements Reducer { reduce () { // Pseudo reduce funtion - ignoring the proper syntax // The processing goes here. output.collect ( new NullWritable(), new Text(output_string) ); } } Finally in the main method of the Driver Class: // For the Map Class jobconf.setMapOutputKeyClass(IntWritable.class); jobconf.setMapOutputValueClass(Text.class); // For the Reduce Class jobconf.setOutputKeyClass(NullWritable.class); jobconf.setOutputValueClass(Text.class); Please do correct me if my understanding is wrong. Thanks again for your help! Warm Regards Arko On Wed, Sep 14, 2011 at 11:12 PM, wrote: > Akro > =A0 =A0 To add on, if you want to ignore =A0the key part then substitute = key with NullWritable. And do the desired modification in driver class in p= lace of output key type. > > Hope it helps > Regards > Bejoy K S > > -----Original Message----- > From: bejoy.hadoop@gmail.com > Date: Thu, 15 Sep 2011 04:09:12 > To: > Reply-To: bejoy.hadoop@gmail.com > Subject: Re: Reducers without output files > > Hi Akro > =A0 =A0 =A0 You can achieve the same within the existing mapreduce frame = work itself. Give a NullWritable in place of reducer output value in reduce= function. In your driver class as well mention the output value type as Nu= llWritable. > > ------Original Message------ > From: Arko Provo Mukherjee > To: mapreduce-user@hadoop.apache.org > ReplyTo: mapreduce-user@hadoop.apache.org > Subject: Reducers without output files > Sent: Sep 15, 2011 08:56 > > Hello Everyone, > > I have a small issue with my Reducer that I am trying to figure out > and wanted some advice. > > In the reducer, when writing to the output file as declared in > FileOutputFormat.setOutputPath() I want to write only the key and not > the value when I am calling output.collect(). > > Is there a way I can ignore the key part? > > Else, > > Can I write a Reducer function that doesn't do a output.collect()?? > > Say I omit the FileOutputFormat.setOutputPath() in the Driver Class. > > I can then manually write the output to HDFS in the format I like. > > Is this legal way to do stuff? > > Many thanks in advance! > Warm Regards > Arko > > > Regards > Bejoy K S