Grokbase Groups Pig user May 2013
FAQ
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

Search Discussions

  • Jonathan Coveney at May 7, 2013 at 8:33 am
    cdh-user to bcc

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


    2013/5/7 abhishek <abhishek.dodda1@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

    --


  • Abhishek at May 7, 2013 at 1:48 pm
    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 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 <abhishek.dodda1@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

    --
    --

  • Ankit Bhatnagar at May 9, 2013 at 10:24 pm
    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.(ByteBuffer.java:306)



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


    Ankit

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedMay 7, '13 at 2:52a
activeMay 9, '13 at 10:24p
posts4
users3
websitepig.apache.org

People

Translate

site design / logo © 2021 Grokbase