我正在尝试集成mongodb配置单元并在执行时收到此错误:
查询:Select * from minute_bars;
Exception in thread "main" java.lang.NoSuchMethodError: com.mongodb.DB.isAuthenticated()Z
at com.mongodb.hadoop.util.MongoConfigUtil.getCollection(MongoConfigUtil.java:328)
at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitterByStats(MongoSplitterFactory.java:76)
at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:114)
at com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:64)
at com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:44)
at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:442)
at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:588)
at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:561)
at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:138)
at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1621)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:267)
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:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
据我所知,我已经导入了罐子:
add jar /home/gumbi/bigdata/hadoop-2.7.2/bin/hive-serde-0.10.0.jar;
add jar /home/gumbi/bigdata/hadoop-2.7.2/bin/mongo-java-driver-3.2.2.jar;
add jar /home/gumbi/bigdata/hadoop-2.7.2/bin/mongo-hadoop-core_2.2.0-1.2.0.jar;
add jar /home/gumbi/bigdata/hadoop-2.7.2/bin/mongo-hadoop-hive_2.2.0-1.2.0.jar;
我尝试创建一个表,工作正常,但无法执行select查询。 表创建查询如下:
CREATE EXTERNAL TABLE minute_bars
(
id string,
userId string,
memberId string,firstName string
)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'WITH SERDEPROPERTIES('mongo.columns.mapping'='{"id":"_id","userId":"userId","memberId":"memberId","firstName":"firstName"}')TBLPROPERTIES('mongo.uri'='mongodb://localhost:27017/localvedantu.orgmembers');