我在 Pig 中有这段代码(win、request 和 response 只是直接从文件系统加载的表):
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);
基本上我想在加入和分组后对 bid_price 求和,但出现错误:
Could not infer the matching function for org.apache.pig.builtin.SUM as multiple or none of them fit. Please use an explicit cast.
我的猜测是我没有正确引用win.bid_price
.