You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by yo...@wipro.com on 2012/09/19 22:26:15 UTC

How Select the top records

Hi all,

I have run the script. and dump it .

1.) Bcount = foreach Bgroup generate group, COUNT(Btop) as number ;

2.) Border = order Bcount by number desc;

3.) Dump Border ;

and the its Output is like.

(10.100.195.16,48)
(208.82.124.93,31)
(210.172.234.116,9)
(192.223.163.5,6)
(108.28.16.81,4)
(125.16.95.11,4)
(202.46.23.55,4)
(203.129.242.34,4)
(115.112.233.75,4)
(204.4.131.140,3)
(134.159.168.105,3)
(70.178.1.235,3)
(31.178.7.2,2)
(67.195.111.170,2)
(209.85.224.91,1)
(66.249.72.105,1)
(68.225.229.67,1)


Now I want the records whose count(Btop) as number is greater than 3.
{(last coloum of each row )like here number are in desending order 49, 31, 9, 6, 4, 4, 4, 3 ...  etc }

How to get these records.
 Please suggest

Thanks & regards
Yogesh Kumar





Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

RE: How Select the top records

Posted by wi...@thomsonreuters.com.
Maybe use FILTER(): http://pig.apache.org/docs/r0.8.1/piglatin_ref2.html#FILTER

William F Dowling
Senior Technologist
Thomson Reuters

-----Original Message-----
From: yogesh.kumar13@wipro.com [mailto:yogesh.kumar13@wipro.com] 
Sent: Wednesday, September 19, 2012 4:26 PM
To: user@pig.apache.org
Subject: How Select the top records
Importance: High

Hi all,

I have run the script. and dump it .

1.) Bcount = foreach Bgroup generate group, COUNT(Btop) as number ;

2.) Border = order Bcount by number desc;

3.) Dump Border ;

and the its Output is like.

(10.100.195.16,48)
(208.82.124.93,31)
(210.172.234.116,9)
(192.223.163.5,6)
(108.28.16.81,4)
(125.16.95.11,4)
(202.46.23.55,4)
(203.129.242.34,4)
(115.112.233.75,4)
(204.4.131.140,3)
(134.159.168.105,3)
(70.178.1.235,3)
(31.178.7.2,2)
(67.195.111.170,2)
(209.85.224.91,1)
(66.249.72.105,1)
(68.225.229.67,1)


Now I want the records whose count(Btop) as number is greater than 3.
{(last coloum of each row )like here number are in desending order 49, 31, 9, 6, 4, 4, 4, 3 ...  etc }

How to get these records.
 Please suggest

Thanks & regards
Yogesh Kumar


Re: How Select the top records

Posted by Srini <pi...@gmail.com>.
-- >  Bcount = foreach Bgroup generate group, COUNT(Btop) as number ;
--> Output= FILTER Bcount by number > 3;
--> DUMP Output;

On Wed, Sep 19, 2012 at 1:26 PM, <yo...@wipro.com> wrote:

> Hi all,
>
> I have run the script. and dump it .
>
> 1.) Bcount = foreach Bgroup generate group, COUNT(Btop) as number ;
>
> 2.) Border = order Bcount by number desc;
>
> 3.) Dump Border ;
>
> and the its Output is like.
>
> (10.100.195.16,48)
> (208.82.124.93,31)
> (210.172.234.116,9)
> (192.223.163.5,6)
> (108.28.16.81,4)
> (125.16.95.11,4)
> (202.46.23.55,4)
> (203.129.242.34,4)
> (115.112.233.75,4)
> (204.4.131.140,3)
> (134.159.168.105,3)
> (70.178.1.235,3)
> (31.178.7.2,2)
> (67.195.111.170,2)
> (209.85.224.91,1)
> (66.249.72.105,1)
> (68.225.229.67,1)
>
>
> Now I want the records whose count(Btop) as number is greater than 3.
> {(last coloum of each row )like here number are in desending order 49, 31,
> 9, 6, 4, 4, 4, 3 ...  etc }
>
> How to get these records.
>  Please suggest
>
> Thanks & regards
> Yogesh Kumar
>
>
>
>
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
>