Grokbase Groups Pig user June 2011
FAQ
Hi,
I have a really weird problem ....i am new to PIG so I don't really understand this SUM function error

ERROR 1045: Could not infer the matching function for org.apache.pig.builtin.SUM as multiple or none of them fit. Please use an explicit cast

I am using pig 0.8.1 from your website.... And the script is simple

%default INPUT_DIR '/user/test/input';
%default OUTPUT_DIR '/user/test/output';


ee = load '$INPUT_DIR/myData' USING PigStorage(',') AS (myId:int, myNumber:int , mycount:int);

aa = foreach ee generate SUM(mycount);

STORE aa INTO '$OUTPUT_DIR/g6' using PigStorage(',');

I even tried

ee = load '$INPUT_DIR/myData' USING PigStorage(',') AS (myId:int, myNumber:int , mycount:int);

aa = foreach ee generate SUM(ee.mycount);

STORE aa INTO '$OUTPUT_DIR/g6' using PigStorage(',');

Nothing.


Regards, Marian

Search Discussions

  • Raghu Angadi at Jun 29, 2011 at 4:28 pm
    try :

    aa = foreach ( group ee all ) generate SUM(mycount);

    read description and examples of 'GROUP' in PIG manual.
    Raghu.
    On Wed, Jun 29, 2011 at 8:36 AM, Marian Condurache wrote:

    Hi,
    I have a really weird problem ....i am new to PIG so I don't really
    understand this SUM function error

    ERROR 1045: Could not infer the matching function for
    org.apache.pig.builtin.SUM as multiple or none of them fit. Please use an
    explicit cast

    I am using pig 0.8.1 from your website.... And the script is simple

    %default INPUT_DIR '/user/test/input';
    %default OUTPUT_DIR '/user/test/output';


    ee = load '$INPUT_DIR/myData' USING PigStorage(',') AS (myId:int,
    myNumber:int , mycount:int);

    aa = foreach ee generate SUM(mycount);

    STORE aa INTO '$OUTPUT_DIR/g6' using PigStorage(',');

    I even tried

    ee = load '$INPUT_DIR/myData' USING PigStorage(',') AS (myId:int,
    myNumber:int , mycount:int);

    aa = foreach ee generate SUM(ee.mycount);

    STORE aa INTO '$OUTPUT_DIR/g6' using PigStorage(',');

    Nothing.


    Regards, Marian

  • Marian Condurache at Jun 29, 2011 at 4:36 pm
    Thanks it worked

    -----Ursprüngliche Nachricht-----
    Von: Raghu Angadi
    Gesendet: Mittwoch, 29. Juni 2011 18:28
    An: user@pig.apache.org
    Betreff: Re: SUM function problem

    try :

    aa = foreach ( group ee all ) generate SUM(mycount);

    read description and examples of 'GROUP' in PIG manual.
    Raghu.
    On Wed, Jun 29, 2011 at 8:36 AM, Marian Condurache wrote:

    Hi,
    I have a really weird problem ....i am new to PIG so I don't really
    understand this SUM function error

    ERROR 1045: Could not infer the matching function for
    org.apache.pig.builtin.SUM as multiple or none of them fit. Please use an
    explicit cast

    I am using pig 0.8.1 from your website.... And the script is simple

    %default INPUT_DIR '/user/test/input';
    %default OUTPUT_DIR '/user/test/output';


    ee = load '$INPUT_DIR/myData' USING PigStorage(',') AS (myId:int,
    myNumber:int , mycount:int);

    aa = foreach ee generate SUM(mycount);

    STORE aa INTO '$OUTPUT_DIR/g6' using PigStorage(',');

    I even tried

    ee = load '$INPUT_DIR/myData' USING PigStorage(',') AS (myId:int,
    myNumber:int , mycount:int);

    aa = foreach ee generate SUM(ee.mycount);

    STORE aa INTO '$OUTPUT_DIR/g6' using PigStorage(',');

    Nothing.


    Regards, Marian

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedJun 29, '11 at 3:37p
activeJun 29, '11 at 4:36p
posts3
users2
websitepig.apache.org

2 users in discussion

Marian Condurache: 2 posts Raghu Angadi: 1 post

People

Translate

site design / logo © 2021 Grokbase