"Encountered: <EOF> after : "" " 是什么意思使用猪

what does "Encountered: <EOF> after : "" " mean using pig

我是 Hadoop 和 Pig 的初学者。我检查了cloudera virtual image中证明的例子,并将其修改为统计前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 未正确结束于 semicolon.
2.STORE stmt 输出文件未正确包含在 single quotes.
中 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';

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