使用猪批量装载

时间:2013-09-23 09:40:46

标签: hadoop hbase apache-pig

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);

我正在执行上面的猪脚本,用于在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

请帮助

1 个答案:

答案 0 :(得分:0)

STORE功能不能有AS'。请参阅文档:http://pig.apache.org/docs/r0.10.0/basic.html#store