Coveney,
Thanks for the reply
Got the answer using nested foreach.
a = load 'data' using PigStorage(',');
b = foreach a {
c = substring(col1,0,4);
generate
332 as x,
c;
}
Sent from my iPhone
On May 7, 2013, at 4:33 AM, Jonathan Coveney <[email protected]> wrote:
> cdh-user to bcc
>
> Your question doesn't make much sense...I think you may have left a piece off?
>
>
> 2013/5/7 abhishek <[email protected]>
>> Hi all,
>>
>> In my script
>>
>> a = load 'data' using PigStorage();
>>
>> b = foreach a generate
>> 342 as col1,
>> substring(x,0,4) as col2,
>> ;
>>
>> I want to use col2 later in foreach statement.
>>
>> derived col2 should be used below.
>>
>> Regards
>> Abhi
>>
>> --
>
> --
>
>
>