这是我正在运行的代码:
bigrams = LOAD 's3://******' AS (bigram:chararray, year:int, occurrences:int, books:int);
bg_tmp = filter bigrams BY (occurrences >= 300) AND (books >= 12);
bg_tmp_2 = GROUP bg_tmp ALL;
occ_cnt = FOREACH bg_tmp_2 GENERATE bigram, SUM(bg_tmp_2.occurrences);
x = LIMIT occ_cnt 100;
DUMP x;
这就是我在计算时遇到的错误 occ_cnt
```
81201 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Pig script failed to parse: <line 5, column 48> Invalid scalar projection: bg_tmp_218/10/26 16:05:07 ERROR grunt.Grunt: ERROR 1200: Pig script failed to parse: <line 5, column 48> Invalid scalar projection: bg_tmp_2
Details at logfile: /mnt/var/log/pig/pig_1540569826316.log
我不知道为什么会这样。我在aws emr上使用apachepig0.17.0和hadoop2.8.4
1条答案
按热度按时间jdzmm42g1#
我会把你的问题改写为
替换group all,因为我认为您需要每个bigram条目的总和。用bg\u tmp替换bg\u tmp2,因为您希望在bg\u tmp\u 2关系中引用bg\u tmp包。
(如果运行“descripe bg\u tmp\u 2”,您将看到以下模式)