我尝试按照https://github.com/mongodb/mongo-hadoop/wiki/Hive-Usage
中的准则创建基于mongodb的配置单元表 CREATE TABLE individuals
(
id INT,
name STRING,
age INT,
work STRUCT<title:STRING, hours:INT>
)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'
WITH SERDEPROPERTIES('mongo.columns.mapping'='{"id":"_id","work.title":"job.position"}')
TBLPROPERTIES('mongo.uri'='mongodb://localhost:27017/test.persons');
我正在使用配置单元2.3.3,hadoop 2.9.1,mongodb 4.0.4。 我还添加了mongo-hadoop-core-2.0.2.jar,mongo-hadoop-hive-2.0.2和mongo-java-driver-3.2.1.jar。