You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by abhishek <ab...@gmail.com> on 2013/05/07 04:52:17 UTC

Pig question

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

Load multiple files

Posted by Ankit Bhatnagar <an...@yahoo-inc.com>.
Hi folks,

I wanted to reach out to see if somebody has encountered a similar issue.

Reading multiple file fails with error- (Pig + ozzie)

 

The mapper syslog Error:

g2013-04-24 07:22:45,905 FATAL [main] org.apache.hadoop.mapred.YarnChild:
Error
running child : java.lang.OutOfMemoryError
    at sun.misc.Unsafe.allocateMemory(Native Method)
    at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:127)
    at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:306)



However the same works while running independently thru command line (Pig
run)


Ankit


Re: Pig question

Posted by abhishek <ab...@gmail.com>.
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 <jc...@gmail.com> 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 <ab...@gmail.com>
>> 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
>> 
>> --
> 
> -- 
>  
>  
>  

Re: Pig question

Posted by Jonathan Coveney <jc...@gmail.com>.
cdh-user to bcc

Your question doesn't make much sense...I think you may have left a piece
off?


2013/5/7 abhishek <ab...@gmail.com>

> 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
>
> --
>
>
>
>