You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Shin Chan <ha...@gmx.com> on 2012/04/17 12:50:58 UTC

Could not infer the matching function SUM function

I know this is very common problem , i read lots of messages for this.

 But i was not able to see why its not working

 I am having serviceTransform1 , whose schema is given below.

 I am trying to generate SUM , COUNT for various fields in it.

 But somehow its not working.

 I am getting error

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


 serviceTransform1:
 {
 var_I: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_J: chararray,
 var_K: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_L: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_A: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_B: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_C: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_D: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_E: chararray,
 var_n: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_F: chararray,
 var_m: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_G: chararray,
 serviceLookup3::serviceLookup2::serviceLookup1::serviceFilter1::var_H: chararray
 }


 serviceTransform1Group = group serviceTransform1 ALL;

 serviceTransform2 = foreach serviceTransform1Group {

 inter = serviceTransform1.var_I;
 generate SUM(inter);
 };