Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 97502 invoked from network); 6 Jun 2008 00:14:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jun 2008 00:14:41 -0000 Received: (qmail 57517 invoked by uid 500); 6 Jun 2008 00:14:40 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 57484 invoked by uid 500); 6 Jun 2008 00:14:40 -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 57473 invoked by uid 99); 6 Jun 2008 00:14:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 17:14:40 -0700 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 chenyangyinpeng@gmail.com designates 209.85.132.240 as permitted sender) Received: from [209.85.132.240] (HELO an-out-0708.google.com) (209.85.132.240) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2008 00:13:51 +0000 Received: by an-out-0708.google.com with SMTP id c37so200221anc.49 for ; Thu, 05 Jun 2008 17:14:07 -0700 (PDT) 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=6KmWTENKLOWn/fvdoVe5/+peN6mYCcGqJaBL+4yPUpw=; b=ZK2hT6wsDzyJDvBoMIyvL4D0E6hmjuLeMjV7Q4Q6IUqzHOb09AMoTWYULWtm6uWJCB 1vz3m3eagAP6Qw/6J4H7CDw77DEtP/KU0KbzhigN48Tn1EYbgAZoIIuP5/wBSqs+aIsk b/TnDFEDSlbYjI/Y/nYEywQqZnmKLrNXc2KNo= 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=JiRNjabbHLj83u6uhsXJ3xJaPW153hklprtOEQNvKbJ7Jd2fqD0rG+L3f0a8Zh7wj7 tMETbS/zHcv2bd6Uam14d94yzo62yeq+lEt92G74Yfl1Py3v/ST3XyaxAc7Tz0KSVJ5J d+ycvPHfvJJ+Knmf1Mrf3z1Sd+nEnX5hQ38jI= Received: by 10.101.68.10 with SMTP id v10mr3613230ank.17.1212711247646; Thu, 05 Jun 2008 17:14:07 -0700 (PDT) Received: by 10.100.44.8 with HTTP; Thu, 5 Jun 2008 17:14:07 -0700 (PDT) Message-ID: Date: Thu, 5 Jun 2008 20:14:07 -0400 From: "Yang Chen" To: core-user@hadoop.apache.org Subject: Re: MapWritable as output value of Reducer In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8534_26723564.1212711247646" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_8534_26723564.1212711247646 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I believe the (key, value) structure is same both input and output file. In this case, you can consider the job flow. Like below, JobConf confA = new JobConf(A.class); conf.setJobName("A"); conf.setOutputKeyClass(Text.class); conf.setOutputValueClass(IntWritable.class); conf.setMapperClass(MapA.class); conf.setCombinerClass(ReduceA.class); conf.setReducerClass(ReduceA.class); conf.setInputFormat(TextInputFormat.class); conf.setOutputFormat(TextOutputFormat.class); conf.setInputPath(new Path("/inputA")); conf.setOutputPath(new Path("/outputA")); JobClient.runJob(confA); JobConf confB = new JobConf(B.class); conf.setJobName("B"); conf.setOutputKeyClass(Text.class); conf.setOutputValueClass(IntWritable.class); conf.setMapperClass(MapB.class); conf.setCombinerClass(ReduceB.class); conf.setReducerClass(ReduceB.class); conf.setInputFormat(TextInputFormat.class); conf.setOutputFormat(TextOutputFormat.class); conf.setInputPath(new Path("/outputA")); conf.setOutputPath(new Path("/outputB")); JobClient.runJob(confB); On Thu, Jun 5, 2008 at 7:36 PM, Tarandeep Singh wrote: > hi, > > Can I use MapWritable as an output value of a Reducer ? > > If yes, how will the (key, value) pairs in the MapWritable object will be > written to the file ? What output format should I use in this case ? > > Further, I want to chain the output of the first map reduce job to another > map reduce job, so in the second map reduce job, what input format should I > specify ? > > Can I reconstruct the MapWritable objects in the mapper of the second job ? > > Thanks, > Taran > ------=_Part_8534_26723564.1212711247646--