I am begI am trying to install and configure hive with mongo-hadoop-core 2.0.2, for the first time. I have installed hadoop 2.8.0, Hive 2.1.1 and MongoDB 3.4.6. and everything works fine when running individually. My problem is, I am not able to connect MongoDB with Hive. I am using mongo-Hadoop connector for this as mentioned here https://github.com/mongodb/mongo-hadoop/wiki/Hive-Usage The required jars are added to Hadoop and Hive lib. Even I add them in hive.sh or runtime from hive console. I am getting error while executing Create table query My Query is
And I get the following error
It shows that com/mongodb/hadoop/io/BSONWritable class is not in
classpath but I have added the required(mongo-hadoop-core.jar) jar and
class are present in the jar. The version of jars I am using mongo-hadoop-core 2.0.2, mongo-hadoop-hive 2.0.2, mongo-java-driver 3.0.2 Thanks |
|
I am trying to install and configure hive with mongo-hadoop-core 2.0.2, for the first time. I have installed hadoop 2.8.0, Hive 2.1.1 and MongoDB 3.4.6. and everything works fine when running individually. |
My problem is, I am not able to connect MongoDB with Hive. I am using mongo-Hadoop connector for this as mentioned here https://github.com/mongodb/mongo-hadoop/wiki/Hive-Usage The required jars are added to Hadoop and Hive lib. Even I add them in hive.sh and runtime from hive console (with ADD JAR .....). I am getting error while executing Create table query |
It shows that com/mongodb/hadoop/io/BSONWritable class is not in classpath
H Prathamesh,
Based on the error message that you’re getting it is likely that mongo-hadoop-core
is not registered properly, as the class com.mongodb.hadoop.io.BSONWritable
is in mongo-hadoop-core-2.0.2.jar
.
Note that with Apache Hive, you need to specify full path to the jar, for example:
ADD JAR /full/path/to/mongo-hadoop-core-2.0.2.jar;
Unrelated to your question, I would also recommend to use mongo-java-driver
version 3.4.x if you are using MongoDB server v3.4.6.
See also MongoDB Java driver compatibility
Regards,
Wan.