Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 13227 invoked from network); 21 Jul 2008 18:32:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2008 18:32:23 -0000 Received: (qmail 58584 invoked by uid 500); 21 Jul 2008 18:32:20 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 57696 invoked by uid 500); 21 Jul 2008 18:32:18 -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 57685 invoked by uid 99); 21 Jul 2008 18:32:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 11:32:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of nguyen.h.khanh@gmail.com designates 66.249.90.178 as permitted sender) Received: from [66.249.90.178] (HELO ik-out-1112.google.com) (66.249.90.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 18:31:24 +0000 Received: by ik-out-1112.google.com with SMTP id c28so1069512ika.5 for ; Mon, 21 Jul 2008 11:31:48 -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:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=sWSlNpA7+PXsCdZRB4iDo9dihIsCBpxrAeSHg0Ls0RE=; b=nK6ZFi7OxPsbKg7kSWKx6YtPQpbTm/N3/T6MmUyn5p4TFquc4Agq5qFAhP0uBhIoA3 0ojp6yYrhErCVn4uZX1NBpJwBrWOHqlvmN+7h9VMiEdcI6xSOH1K8pgQTMiIIGBUnRah QE0EHkqFlxe0wwvgIHIbyTuGaq9JlqUrU2SH8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=d8wJbgNxjDKUrPOm3AYZo8pj17pbUMXjvBprcZ5XRDDAhd4x5WkavppqUWrvPkUbq7 X/pVKXF/NQcg65utvk68UntzYjWr0SfTchJiphLLd6evQegXYk9v39RGVBDR+OCrAoNt 3h8URM1i1GwFRct6+okqmbiPcgPjR+IpgVLCU= Received: by 10.210.51.10 with SMTP id y10mr3584991eby.57.1216665108063; Mon, 21 Jul 2008 11:31:48 -0700 (PDT) Received: by 10.210.10.14 with HTTP; Mon, 21 Jul 2008 11:31:48 -0700 (PDT) Message-ID: <2871c9e10807211131w2522f963k2bdcd432c55031b1@mail.gmail.com> Date: Mon, 21 Jul 2008 14:31:48 -0400 From: "Khanh Nguyen" Sender: nguyen.h.khanh@gmail.com To: core-user@hadoop.apache.org Subject: Re: type mismatch from key to map In-Reply-To: <2871c9e10807211044x1a64edb3xf0de3ff07bcda26@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2871c9e10807211025q29656e09y99b3ff69720a8c5@mail.gmail.com> <6a8ad9cf0807211030o4a83f012u5a8036ee2ef063b2@mail.gmail.com> <2871c9e10807211044x1a64edb3xf0de3ff07bcda26@mail.gmail.com> X-Google-Sender-Auth: 3ea9683d43034e52 X-Virus-Checked: Checked by ClamAV on apache.org Nevermind, I figured out my problem. I did not configure OutputFormat. On Mon, Jul 21, 2008 at 1:44 PM, Khanh Nguyen wrote: > Hi Daniel, > > The outputformat of my 1st hadoop job is TextOutputFormat. The > skeleton of my code follows: > > public int run(String[] args) throws Exception { > //set up and run job 1 > ... > conf.setOutputFormat(TextOutputFormat.class); > FileOutputFormat.setOutputPath(conf, new Path(args[1])); > > .... > //set up and run job 2 > ....... > FileInputFormat.addInputPath(sortJob, new Path(args[1] + > "/part-00000")); > FileOutputFormat.setOutputPath(sortJob, new Path(args[1] > + "/result/")); > sortJob.setInputFormat(KeyValueTextInputFormat.class); > sortJob.setMapperClass(InverseMapper.class) > ...... > > } > > Please help. > > -k > > On Mon, Jul 21, 2008 at 1:30 PM, Daniel Yu wrote: >> hi k, >> i think u should look at ur map output format setting, and check if that >> fits ur reduce input . >> >> Daniel >> >> 2008/7/21 Khanh Nguyen : >> >>> Hello, >>> >>> I am getting this error >>> >>> java.io.IOException: Type mismatch in key from map: expected >>> org.apache.hadoop.io.LongWritable, recieved org.apache.hadoop.io.Text >>> >>> >>> Could someone please explain to me what i am doing wrong. Follow is >>> the code I think is responsible... >>> >>> public int run() { >>> ..... >>> >>> sortJob.setInputFormat(KeyValueTextInputFormat.class); >>> >>> sortJob.setMapperClass(InverseMapper.class); >>> .... >>> >>> } >>> >>> Thanks >>> >>> -k >>> >> >