I have this code in Pig (win, request and response are just tables loaded directly from filesystem):
win_request = JOIN win BY bid_id, request BY bid_id;
win_request_response = JOIN win_request BY win.bid_id, response BY bid_id;
win_group = GROUP win_request_response BY (win.campaign_id);
win_count = FOREACH win_group GENERATE group, SUM(win.bid_price);
Basically I want to sum the bid_price after joining and grouping, but I get an 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.
My guess is that I'm not referring correctly to win.bid_price
.