我想用pig计算2和的除法
A = LOAD 's3://input' AS (filed1:chararray, filed2:int, field3:float, field4:float);
filtered_1 = FILTER A BY field3 >= 10;
filtered_2 = FILTER filtered_1 BY field4 >= 50;
grouped = GROUP filtered_2 BY field1;
B = FOREACH grouped GENERATE group as field1, SUM(A.field3)/SUM(A.field4) AS A_avg;
但我在运行上一个命令时出现了以下错误:
ERROR grunt.Grunt: ERROR 1045: <line 5, column 55> Could not infer the matching function for org.apache.pig.builtin.SUM as multiple or none of them fit. Please use an explicit cast.
我也找不到原因,因为我在执行sum之前使用了group,而且我已经浏览了sum文档,我不知道和我写的有什么不同
1条答案
按热度按时间wi3ka0sx1#