Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 97369 invoked from network); 20 Feb 2008 02:02:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2008 02:02:04 -0000 Received: (qmail 82598 invoked by uid 500); 20 Feb 2008 02:01:55 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 82565 invoked by uid 500); 20 Feb 2008 02:01:55 -0000 Mailing-List: contact core-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-user@hadoop.apache.org Delivered-To: mailing list core-user@hadoop.apache.org Received: (qmail 82555 invoked by uid 99); 20 Feb 2008 02:01:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2008 18:01:55 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of annndy.lee@gmail.com designates 72.14.220.156 as permitted sender) Received: from [72.14.220.156] (HELO fg-out-1718.google.com) (72.14.220.156) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 02:01:18 +0000 Received: by fg-out-1718.google.com with SMTP id 16so2029075fgg.35 for ; Tue, 19 Feb 2008 18:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=txfmTdDlGrNN4F1byAPcm8CDlVRIWM490xGVdz5Mpso=; b=m1yZV73W2li/hOFas8HW6g+5IsR2R49vLa8bkQkhqhCarnUjoqIbDzD3cm85imx3zDEDiGsntCQLxwBwFHT3F1wCWFagz3XPmm6DXenHyCkaUVqq+xb2zGBVLXLvWTdyDTiLWRYAidDLszYykPjKb494sTGkQb3KuDmEtembi7A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=BO77iXCpbPxIhR3e8janvuWIJAv11e1B1JknBdTtnmLt5xeVj+xAcdRnqCI4NaXCqJW3nERMPNB1+BBpZlyC0j9Kz0WuO+EV9XhHpXYpsy2axK6pZMWh2Db9CelleypGYcnybANg9skRznhdK+yPeeqQ9qNtDwTCMeEgRM8ZzJA= Received: by 10.86.79.19 with SMTP id c19mr7890643fgb.16.1203472886253; Tue, 19 Feb 2008 18:01:26 -0800 (PST) Received: by 10.86.82.7 with HTTP; Tue, 19 Feb 2008 18:01:21 -0800 (PST) Message-ID: <8e8d18110802191801v10934e69o50ed3ab95e91e3c9@mail.gmail.com> Date: Tue, 19 Feb 2008 18:01:21 -0800 From: "Andy Li" To: core-user@hadoop.apache.org Subject: Re: FileOutputFormat which does not write key value? In-Reply-To: <52c3ddca0802191502j5d27f35bs5c82a27ac43f9418@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6386_21021500.1203472886243" References: <52c3ddca0802191352r7588c1dan61268ec747724130@mail.gmail.com> <6F942F54-15A6-428D-875A-C486F0D9A652@yahoo-inc.com> <52c3ddca0802191502j5d27f35bs5c82a27ac43f9418@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_6386_21021500.1203472886243 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Shouldn't the official way to do this is to implement your own RecordWriter and implement the OutputFormatClass. conf.setOutputFormat(yourClass); Inside the yourClass, you can return your own RecordWriter class in the getRecordWriter method. I did it on the FileInputFormat with my own RecordReader and it worked for me to take KEY and null VALUE into the Mapper. I believe it is the same thing vice versa. But there should be a formal way instead of try-and-error to see what the system default is. I guess the system does not have a standard spec to define what is the default values? Maybe this is why Ted has such concern of incompatible in 0.16.*? -Andy On Feb 19, 2008 3:02 PM, Lukas Vlcek wrote: > Hmmm... > > May be I should rather go to bet (it is just midnight in my part of the > world...) but I think I did what you are saying: > > Configuration: > conf.setOutputKeyClass(NullWritable.class); > conf.setOutputValueClass(Text.class); > > And the reducer: > public class PermutationReduce extends MapReduceBase implements > Reducer { > > public void reduce(Text key, Iterator values, > OutputCollector output, Reporter reporter) throws > IOException { > while (values.hasNext()) { > output.collect(NullWritable.get(), values.next()); > } > > } > } > > Regards, > Lukas > > On 2/19/08, Owen O'Malley wrote: > > > > > > On Feb 19, 2008, at 1:52 PM, Lukas Vlcek wrote: > > > > > Hi, > > > > > > I don't care about key value in the output file. Is there any way > > > how I can > > > suppress key in the output? > > > Is there a way how to tell (Text)OutputFormat not to write key but > > > value > > > only? Or can I pass my own implementation of RecordWriter into > > > FileOutputFormat? > > > > The easiest way is to put either null or a NullWritable in for the > > key coming out of the reduce. The TextOutputFormat will drop the tab > > character. You can also define your own OutputFormat and encode them > > as you wish. > > > > -- Owen > > > > > > -- > http://blog.lukas-vlcek.com/ > ------=_Part_6386_21021500.1203472886243--