抱歉天真的问题。我是新手。我有一个Pig脚本,并得到以下错误:
ERROR [main] org.apache.pig.tools.grunt.Grunt - ERROR 1200: <file xxx.script, line 2, column 20> mismatched input ';' expecting LEFT_PAREN
这就是我的scipt的样子:
a = load 'xxx.csv' using PigStorage(',') as (person:chararray,store:chararray,spent:float);
b = group a by store;
dump b;
这是堆栈跟踪:
ERROR 1200: <file xxx.script, line 2, column 20> mismatched input ';' expecting LEFT_PAREN
org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. <file xxx.script, line 2, column 20> mismatched input ';' expecting LEFT_PAREN
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1689)
at org.apache.pig.PigServer$Graph.access$000(PigServer.java:1409)
at org.apache.pig.PigServer.parseAndBuild(PigServer.java:342)
at org.apache.pig.PigServer.executeBatch(PigServer.java:367)
at org.apache.pig.PigServer.executeBatch(PigServer.java:353)
at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:140)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:769)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
at org.apache.pig.Main.run(Main.java:607)
at org.apache.pig.Main.main(Main.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:619)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Caused by: Failed to parse: <file /home/biadmin/xxx.script, line 2, column 20> mismatched input ';' expecting LEFT_PAREN
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:241)
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:179)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1676)
... 17 more
答案 0 :(得分:0)
正如@Surender Raja所指出的,商店是一个关键字,在将其更改为deptStore后,我可以用名称而不是$ 1来引用它