after : "“”是什么意思使用 pig-6ren"> after : "“”是什么意思使用 pig-我是 Hadoop 和 Pig 的初学者。我检查了在cloudera虚拟镜像中证明的例子,并对其进行了修改以计算前5个常用词: Lines = LOAD '/user/hue/pig/examples-6ren">
gpt4 book ai didi

hadoop - "Encountered: after : "“”是什么意思使用 pig

转载 作者:可可西里 更新时间:2023-11-01 14:47:04 25 4
gpt4 key购买 nike

我是 Hadoop 和 Pig 的初学者。我检查了在cloudera虚拟镜像中证明的例子,并对其进行了修改以计算前5个常用词:

Lines = LOAD '/user/hue/pig/examples/data/midsummer.txt' as (line:CHARARRAY);
Words = FOREACH Lines GENERATE FLATTEN(TOKENIZE(line)) AS word;
Groups = GROUP Words BY word;
Counts = FOREACH Groups GENERATE group, COUNT(Words);
Results = ORDER Words BY Counts DESC;
Top5 = LIMIT Results 5;
STORE Top5 INTO /user/hue/pig/examples/data/summertop5Hi

但是,当我运行这个脚本时,我得到了这个消息错误:

ERROR org.apache.pig.tools.grunt.Grunt  - ERROR 1000: Error during parsing. Lexical error at line 8, column 0.  Encountered: <EOF> after : ""

这是什么意思?

最佳答案

您需要解决代码中的三个问题才能使其正常工作。
1.STORE stmt没有以分号正确结束。
2.STORE stmt 输出文件未正确用单引号引起来。
3. 需要对 Counts and Results stmt 逻辑稍作修改。

修改后的脚本:

Lines = LOAD '/user/hue/pig/examples/data/midsummer.txt' as (line:CHARARRAY);
Words = FOREACH Lines GENERATE FLATTEN(TOKENIZE(line)) AS word;
Groups = GROUP Words BY word;
Counts = FOREACH Groups GENERATE group, COUNT(Words) AS cnt;
Results = ORDER Counts BY cnt DESC;
Top5 = LIMIT Results 5;
STORE Top5 INTO '/user/hue/pig/examples/data/summertop5';

如果您在脚本中遇到任何问题,请告诉我。

关于hadoop - "Encountered: <EOF> after : "“”是什么意思使用 pig ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28779610/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com