grunt> a = load '/user/horton/flightdelays_clean/part-m-00000' using PigStorage(',');
2016-10-12 15:22:25,593 [主要] INFO org.apache.hadoop.conf.Configuration.deprecation - fs.default.name是 弃用。而是使用fs.defaultFS
grunt> b = group a by $0;
grunt> c = foreach b generate COUNT($0);
2016-10-12 15:22:40,244 [主要]警告 org.apache.pig.newplan.BaseOperatorPlan - 遇到警告 USING_OVERLOADED_FUNCTION 1次。 2016-10-12 15:22:40,248 [主要] 警告org.apache.pig.newplan.BaseOperatorPlan - 遇到警告 IMPLICIT_CAST_TO_BAG 1次。
答案 0 :(得分:1)
您将一个字段作为参数传递给需要某种类型的函数,但该字段是另一种类型 试试这个:
grunt> b = group a by $0;
grunt> c = foreach b generate COUNT(a);
答案 1 :(得分:0)
c = foreach b generate COUNT($0);
应该是
c = foreach b generate COUNT(a);