RE: finding mean and standard deviation

2012-09-26 Thread Manish . Bhoge
To: user@pig.apache.org Subject: Re: finding mean and standard deviation Hi, in = load 'in.txt' using PigStorage(',') as (merchant:int, customer:int, amount:float); perMerchant = group in by merchant; avg = foreach perMerchant generate group, AVG(in.amount); dump avg; This returns (merchant_id

finding mean and standard deviation

2012-09-25 Thread jamal sasha
Hi, I have a huge text file of form data is saved in directory data/data1.txt, data2.txt and so on merchant_id, user_id, amount 1234, 9123, 299.2 1233, 9199, 203.2 1234, 0124, 230 and so on.. What I want to do is for each merchant, find the average amount.. so basically in the end i

Re: finding mean and standard deviation

2012-09-25 Thread Cheolsoo Park
Hi, in = load 'in.txt' using PigStorage(',') as (merchant:int, customer:int, amount:float); perMerchant = group in by merchant; avg = foreach perMerchant generate group, AVG(in.amount); dump avg; This returns (merchant_id, avg of amount) as follows: (1233,203.169482422)

Re: finding mean and standard deviation

2012-09-25 Thread jamal sasha
Hi, Thanks for replying. Err I am a new here. I am trying to find the info as in what is UDF? On Tue, Sep 25, 2012 at 10:41 PM, Cheolsoo Park cheol...@cloudera.comwrote: Hi, in = load 'in.txt' using PigStorage(',') as (merchant:int, customer:int, amount:float); perMerchant = group in by

Re: finding mean and standard deviation

2012-09-25 Thread Cheolsoo Park
Oh, sure. Please find more info about UDF here: http://pig.apache.org/docs/r0.10.0/udf.html On Tue, Sep 25, 2012 at 8:16 PM, jamal sasha jamalsha...@gmail.com wrote: Hi, Thanks for replying. Err I am a new here. I am trying to find the info as in what is UDF? On Tue, Sep 25, 2012 at