Return-Path: X-Original-To: apmail-hadoop-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-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 6DF69D6F2 for ; Mon, 17 Sep 2012 07:17:56 +0000 (UTC) Received: (qmail 15666 invoked by uid 500); 17 Sep 2012 07:17:51 -0000 Delivered-To: apmail-hadoop-user-archive@hadoop.apache.org Received: (qmail 14921 invoked by uid 500); 17 Sep 2012 07:17:45 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 14883 invoked by uid 99); 17 Sep 2012 07:17:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2012 07:17:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lin.yang.jason@gmail.com designates 209.85.220.176 as permitted sender) Received: from [209.85.220.176] (HELO mail-vc0-f176.google.com) (209.85.220.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Sep 2012 07:17:37 +0000 Received: by vcbgb22 with SMTP id gb22so402506vcb.35 for ; Mon, 17 Sep 2012 00:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=zvKf8s7NePLiPmomi73YhChKrJ1Fh71y7vPXtP644FY=; b=pGkWIjdBeUsBi43FD1BI/7aJj7HpQjgukbEurrkTcLkWmIZpUBVMCyGXRSEkTOjOwp Vzk+MDiSaOAT7ZuCXfRhlTuhdxpi3GO5b3zraooj5B8AHOLebTEJO0l/DXoYYsdfYghn +brMXbreSjE/VnNBTRo5OI7uslun0VkNB6NU5JGCp7AWBKx5e66Tzb9lQzc+ODvB4BkN 68mdaB4muB6z4Z3DESxXZfzmBPyBGC++lQxg4my83V5Kv8xI/MskcEkwnWa4kX4ZJwGf ixsgeuTNLAjuPWLZGb19RtHcV8biC+OBpX6gxYYtKMfo6zJQpJnhq77Bu1FjDrG34Zun 86Xw== Received: by 10.52.64.234 with SMTP id r10mr3072547vds.80.1347866237131; Mon, 17 Sep 2012 00:17:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.132.176 with HTTP; Mon, 17 Sep 2012 00:16:57 -0700 (PDT) From: Jason Yang Date: Mon, 17 Sep 2012 15:16:57 +0800 Message-ID: Subject: How to output according to the key in reducer? To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=20cf307ac77544db6304c9e09034 X-Virus-Checked: Checked by ClamAV on apache.org --20cf307ac77544db6304c9e09034 Content-Type: text/plain; charset=ISO-8859-1 Hi, all I was wondering how to write all the input with the same key to a single file in the reducer ? say, I got some intermediate outputs from mappers like that: key value -------------------- 1 annie 2 Jason 1 andy 2 Joey 1 andrew ... and I would like write all the intermediate outputs with key 1 to file "ID_1.dat", and all the intermediate outputs with key 2 to file "ID_2.data". how could I achieve that? -- YANG, Lin --20cf307ac77544db6304c9e09034 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, all

I was wondering how to write all the input with = the same key to a single file in the reducer ?

say= , I got some intermediate outputs from mappers like that:=A0
key = =A0 =A0 value
--------------------
1 =A0 annie
2 =A0 Jason
=
1 =A0 andy
2 =A0 Joey
1 =A0 andrew
...

and I would like write all the=A0intermediate outpu= ts with key 1 to file "ID_1.dat", and all the intermediate output= s with key 2 to file "ID_2.data".

how could I achieve that?

-- <= br>
YANG, Lin

--20cf307ac77544db6304c9e09034--