Return-Path: X-Original-To: apmail-incubator-crunch-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-crunch-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 C9635DC98 for ; Wed, 14 Nov 2012 11:36:35 +0000 (UTC) Received: (qmail 93480 invoked by uid 500); 14 Nov 2012 11:36:35 -0000 Delivered-To: apmail-incubator-crunch-user-archive@incubator.apache.org Received: (qmail 93355 invoked by uid 500); 14 Nov 2012 11:36:32 -0000 Mailing-List: contact crunch-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: crunch-user@incubator.apache.org Delivered-To: mailing list crunch-user@incubator.apache.org Received: (qmail 93333 invoked by uid 99); 14 Nov 2012 11:36:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Nov 2012 11:36:32 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paliwalashish@gmail.com designates 209.85.212.177 as permitted sender) Received: from [209.85.212.177] (HELO mail-wi0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Nov 2012 11:36:26 +0000 Received: by mail-wi0-f177.google.com with SMTP id c10so142532wiw.0 for ; Wed, 14 Nov 2012 03:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=1iFyLP+oX3+cQIun93P/8ynUKUzAGDwabUfXRtSABuQ=; b=M8O6f2G0k0oAUAXwSiVsNF+V8n/1In2uOmOmMPOu6YkHQfLIIGxbGoVv+GXtevhcQg xEOulSijsnKiYGebl8f1cFGerCHNsfTdCJP/xwxvb6H1l2DWTFhcp79N4hOr7A/hllBX jifZQsCfEK+K+IC/kQv8o9yYb/Ns5T3v7Ee6cMaKxalOdQqO6D0XKeybprO0Ob1JruRr ayhYwv5mGUT0CrjniLSoAETWLqLshBMOpCcAENG00HfGpT9irqjOh0HfhWcKK8nWU6ii Y1YWh4hmfCWa7r8chcYBVPCq59lqdQxq1+VrR8bVEKTygRFg5KktXeiG/OxykQNWAnsV vGSg== MIME-Version: 1.0 Received: by 10.180.88.100 with SMTP id bf4mr6934906wib.16.1352892965964; Wed, 14 Nov 2012 03:36:05 -0800 (PST) Received: by 10.216.94.2 with HTTP; Wed, 14 Nov 2012 03:36:05 -0800 (PST) Date: Wed, 14 Nov 2012 17:06:05 +0530 Message-ID: Subject: Sorting output of WordCount example From: Ashish To: crunch-user@incubator.apache.org Content-Type: multipart/alternative; boundary=f46d04428ed4a7cc9304ce72f09d X-Virus-Checked: Checked by ClamAV on apache.org --f46d04428ed4a7cc9304ce72f09d Content-Type: text/plain; charset=ISO-8859-1 Hi All, I am newbie to Crunch. Have been playing wit examples in standalone mode. Was trying to extend the WordCount example, but got stuck. I want to extend the WordCount example to sort the output by max word count. I tried using (PCollections.sort) PTable counts = words.count(); words.sort(false); This code had no effect. Using crunch-0.4 release (under voting) Is there a simple way to achieve this, or need to modify the code according to SecondarySort example. Already have a blog post based on WordCount, want to extend the same example for sorting, so that it's easy to understand. -- thanks ashish Blog: http://www.ashishpaliwal.com/blog My Photo Galleries: http://www.pbase.com/ashishpaliwal --f46d04428ed4a7cc9304ce72f09d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi All,

I am newbie to Crunch. Have been playing wit exa= mples in standalone mode. Was trying to extend the WordCount example, but g= ot stuck.

I want to extend the WordCount example t= o sort the output by max word count. I tried using (PCollections.sort)

PTable<String, Long> counts =3D words.count(= );
words.sort(false);

This code had = no effect. Using crunch-0.4 release (under voting)

Is there a simple way to achieve this, or need to modify the code according= to SecondarySort example.

Already have a blog pos= t based on WordCount, want to extend the same example for sorting, so that = it's easy to understand.

--
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Ga= lleries: http://www.pbase.co= m/ashishpaliwal
--f46d04428ed4a7cc9304ce72f09d--