Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> SUM function problem


Copy link to this message
-
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 <
[EMAIL PROTECTED]> 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
>
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB