|
|
-
Re: SUM function problemRaghu Angadi 2011-06-29, 16:28
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 > > > |