在Pig中的包上使用Enumerate时获取ERROR 1070

时间:2017-08-01 18:09:23

标签: hadoop apache-pig

我正在尝试使用以下代码枚举行李:

  DEFINE Enumerate datafu.pig.bags.Enumerate('1');

  group = GROUP data1
            By (query_text);

  ranked = FOREACH group {
        ordered = ORDER data1 BY score DESC;
        ordered = Enumerate(ordered);
        generate ordered_suggestions;
    };

获得以下错误:

220255 [main] ERROR org.apache.pig.tools.grunt.Grunt  - ERROR 1070: Could not resolve datafu.pig.bags.Enumerate using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
17/08/01 17:54:30 ERROR grunt.Grunt: ERROR 1070: Could not resolve datafu.pig.bags.Enumerate using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
Details at logfile: /mnt/var/log/pig/pig_1501609850542.log

1 个答案:

答案 0 :(得分:0)

我没有注册罐子。

REGISTER 's3:/<<s3-bucket-name>>/lib/datafu-1.2.0.jar';

这很好用:

 REGISTER 's3:/<<s3-bucket-name>>/lib/datafu-1.2.0.jar
 DEFINE Enumerate datafu.pig.bags.Enumerate('1');

  group = GROUP data1
            By (query_text);

  ranked = FOREACH group {
        ordered = ORDER data1 BY score DESC;
        ordered = Enumerate(ordered);
        generate ordered_suggestions;
    };