java—尝试使用hcatstorer()将数据存储到配置单元数据库时出现问题

wgeznvg7  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(293)

我正在使用pig使用hcatalog将表数据存储到配置单元数据库中。我可以在pig grunt shell中加载和转储数据,但是当我试图将加载的数据存储到配置单元表中时,我使用下面的命令创建了myweather.weathertable1(myweather数据库名称,weathertable1-表名称1)

STORE A INTO 'myweather.weathertable1' USING org.apache.hcatalog.pig.HCatStorer();

我遇到以下错误:

2015-07-11 20:20:09,056 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatStorer using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
Details at logfile: /X/Y/pig_1436660283762.log

日志文件上写着:

ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatStorer using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

Failed to parse: Pig script failed to parse:
<line 4, column 45> pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatStorer using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
        at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:196)
        at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1660)
        at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1633)
        at org.apache.pig.PigServer.registerQuery(PigServer.java:587)
        at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:1093)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:501)
        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.run(Grunt.java:69)
        at org.apache.pig.Main.run(Main.java:541)
        at org.apache.pig.Main.main(Main.java:156)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

任何解决上述问题的帮助都是非常值得赞赏的。提前谢谢。

roqulrg3

roqulrg31#

请试着从Pig开始 -useHCatalog 选项。它将装入必要的jar。请参阅hcat文件

相关问题