使用pig的批量加载

cpjpxq1n  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(327)
STORE A INTO 'hbase://xyz' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(' id:id zip:zip desc:desc1 desc:desc2 income:income ') 
 AS (id:id zip:zip desc:desc1 desc:desc2 income:income);

我正在执行上面的pig脚本,以便在hbase中存储数据,我得到以下错误

2013-09-23 05:34:44,676 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " "as" "AS "" at line 1, column 138.
Was expecting one of:
    "parallel" ...
    ";" ...

2013-09-23 05:34:44,676 [main] WARN  org.apache.pig.tools.grunt.Grunt - There is no log file to write to.
2013-09-23 05:34:44,676 [main] ERROR org.apache.pig.tools.grunt.Grunt - org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. Encountered " "as" "AS "" at line 1, column 138.
Was expecting one of:
    "parallel" ...
    ";" ...

        at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1618)
        at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1562)
        at org.apache.pig.PigServer.registerQuery(PigServer.java:534)
        at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:871)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:388)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
        at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
        at org.apache.pig.Main.run(Main.java:455)
        at org.apache.pig.Main.main(Main.java:107)
Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered " "as" "AS "" at line 1, column 138.
Was expecting one of:
    "parallel" ...
    ";" ...

        at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:9599)
        at org.apache.pig.impl.logicalLayer.parser.QueryParser.jj_consume_token(QueryParser.java:9475)
        at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:826)
        at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:63)
        at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1612)
        ... 9 more

请帮忙

8ehkhllq

8ehkhllq1#

存储函数不能有“as”。参考文件:http://pig.apache.org/docs/r0.10.0/basic.html#store

相关问题