我使用hadoop 1.1.2,hbase 0.94.8和hive 0.14。 我正在尝试使用配置单元在hbase中创建一个表,然后通过insert overwrite在其中加载数据。
目前我能够创建表格:
CREATE TABLE hbase_table_emp(id int, name string, role string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:name,cf1:role")
TBLPROPERTIES ("hbase.table.name" = "emp");
并将数据加载到另一个表中,我将其覆盖到hbase表中:
hive> create table testemp(id int, name string, role string) row format delimited fields terminated by '\t';
hive> load data local inpath '/home/user/sample.txt' into table testemp;
但是当我尝试select * from testemp;
验证数据已成功加载时,我收到此错误:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.mapred.JobConf.unset(Ljava/lang/String;)V
at org.apache.hadoop.hive.ql.io.HiveInputFormat.pushFilters(HiveInputFormat.java:432)
at org.apache.hadoop.hive.ql.exec.FetchTask.initialize(FetchTask.java:76)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:443)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:303)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1067)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1129)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:783)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
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:622)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
是的,有人可以帮助我!谢谢
答案 0 :(得分:1)
不幸的是,我相信您必须将Hadoop升级到至少1.2.0。
Hive似乎正在尝试访问unset
类的org.apache.hadoop.mapred.JobConf
方法。在Hadoop 1.1.2中查看该类的API documentation时,您可以看到该方法不存在。
该方法实现的1.x系列的第一个版本是1.2.0(参见同一类的API documentation)。请注意,该方法实际上是从org.apache.hadoop.conf.Configuration
类继承的。