2 jerryliun jerryliun 于 2017.09.07 17:50 提问

Hive1.1对接sequoiadb1.12报错

【版本信息】
Hive1.1
hadoop2.6
sequoiadb1.12

【问题详细描述】
sdb存在default.sdb_tab表和数据,在hive执行"select id from sdb_tab"对该表做查询时报“Exception in thread "main" java.lang.NoSuchMethodError”,详细操作如下:
1、sdb中存在default.sdb_tab表和数据,可正常执行如下命令查看:

db.default.sdb_tab.find();
{
"_id": {
"$oid": "57610212324d1a5779000000"
},
"name": "chen",
"id": 123
}
Return 1 row(s).
Takes 0.2828s.
复制代码

3、hive中执行如下命令报错
hive> select id from sdb_tab;
OK
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.hive.serde2.ColumnProjectionUtils.getReadColumnIDs(Lorg/apache/hadoop/conf/Configuration;)Ljava/util/ArrayList;
at com.sequoiadb.hive.SdbHiveInputFormat.getRecordReader(SdbHiveInputFormat.java:35)
at org.apache.hadoop.hive.ql.exec.FetchOperator$FetchInputFormatSplit.getRecordReader(FetchOperator.java:667)
at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:323)
at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:445)
at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:414)
at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:138)
at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1655)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:227)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:754)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
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)
复制代码

【提问】
1、报错原因?
2、Hive如何在指定集合空间创建一张表,如:foo.bar ,并关联到sequoiadb?

2个回答

SequoiaDB_Official
SequoiaDB_Official   2017.09.08 18:10
已采纳

1、报错原因可能是没有对hive的表和sequoiadb的表做关联关系。
2、hive创建表并关联到sequoiadb的方法如下:
1)sequoiadb创建集合foo.bar
2)hive 连接器在option 选项中,可以指定sequoiadb的cs 和cl 创建关联关系,方法sdb.space 和 sdb.collection,如:
create external table sdb_tab(id INT, name STRING, value DOUBLE) stored by "com.sequoiadb.hive.SdbHiveStorageHandler" tblproperties("sdb.address" = "localhost:11810", "sdb.space" = "foo", "sdb.collection" = "bar");

devmiao
devmiao   Ds   Rxr 2017.09.07 17:56
Csdn user default icon
上传中...
上传图片
插入图片