Re: Pig script : Need help

2014-04-07 Thread Pradeep Gollakota
That is because you're calling REPLACE on a bag of tuples and not a string. What you would want to do is write a UDF (suggested name JOIN_ON), that takes as an argument a join char and will join all the tuples in the bag by the join char. On Mon, Apr 7, 2014 at 12:31 PM, Krishnan Narayanan < kris

Re: Pig script : Need help

2014-04-07 Thread Krishnan Narayanan
Thanks Ankit, I am getting the desired result. What i did was I group by year but did not use any aggregate function so that the output is a bag(tuples). Now when I try to apply replace function for replacing the curly braces and brackets so that it will look 2014,2013 but it gives me error can't

Re: Pig script : Need help

2014-04-01 Thread Ankit Bhatnagar
Run a group by year field Then do whatever u want to do On 4/1/14 5:45 PM, "Krishnan Narayanan" wrote: >Hi All, > >Using Pig how can I achieve the below mentioned output from the input. > >Input > >year , 2000 >year , 2001 >year , 2002 > >OutPut > >year 2000|2001|2002 ( in one row). > >Thanks >

Pig script : Need help

2014-04-01 Thread Krishnan Narayanan
Hi All, Using Pig how can I achieve the below mentioned output from the input. Input year , 2000 year , 2001 year , 2002 OutPut year 2000|2001|2002 ( in one row). Thanks Krishnan