Home:ALL Converter>Import MongoDB data into Hive Error: Splitter implementation is incompatible

Import MongoDB data into Hive Error: Splitter implementation is incompatible

Ask Time:2019-03-12T20:54:24         Author:Bunny

Json Formatter

I'm trying to import mongodb data into hive.

The jar versions that i have used are

ADD JAR /root/HDL/mongo-java-driver-3.4.2.jar;
ADD JAR /root/HDL/mongo-hadoop-hive-2.0.2.jar;
ADD JAR /root/HDL/mongo-hadoop-core-2.0.2.jar;

And my cluster versions are

Ambari - Version 2.6.0.0, HDFS 2.7.3, Hive 1.2.1000, HBase 1.1.2, Tez 0.7.0 MongoDB Server version:- 3.6.5

Hive Script:-

CREATE TABLE sampletable
( ID STRING,
EmpID STRING,
BeginDate DATE,
EndDate DATE,
Time TIMESTAMP,
Type STRING,
Location STRING,
Terminal STRING)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'
WITH SERDEPROPERTIES('mongo.columns.mapping'='{"ID":"_id","EmpID":"emp_id","BeginDate":"begin_date","EndDate":"end_date","Time":"time","Type":"time_event_type","Location":"location","Terminal":"terminal"}')
TBLPROPERTIES('mongo.uri'='mongodb://username:[email protected]:27017/testdb.testtable');

Output:-

hive> select * from sampletable;

OK

Failed with exception java.io.IOException:java.io.IOException: Failed to aggregate sample documents. Note that this Splitter implementation is incompatible with MongoDB versions prior to 3.2.

Please suggest me how can i solve this.

Thanks,

Mohan V

Author:Bunny,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/55122009/import-mongodb-data-into-hive-error-splitter-implementation-is-incompatible
yy