-
Notifications
You must be signed in to change notification settings - Fork 602
FAQ
Frequently Asked questions:
- What types of shard keys are supported by the
ShardChunkMongoSplitter
? java.lang.IncompatibleClassChangeError: Found class XXX, but interface was expected
- Are UUIDs supported by the connector?
- I get a
ClassNotFoundException
/NoClassDefFoundError
when using the connector. What do I do?
The ShardChunkMongoSplitter
does not support a hashed _id
index, since MongoDB will instead use the unhashed _id
index to create the splits, resulting in all data on one split. All other index types are supported, including hashed indexes on fields that are not _id
.
There are two common causes of this Exception:
-
The version of the Hadoop Connector that you're running isn't compatible with your version of Hadoop. Since version 1.3, the Hadoop Connector is compatible with all versions of Hadoop, but this isn't true for versions prior to 1.3. Make sure you have the right version.
-
You're using a different version of the MongoDB Java Driver than what the connector expects. You either need to switch to the version that the connector expects (in either
build.gradle
orproject/MongoHadoopBuild.scala
, depending on the version of the connector that you have), or change the version in that file to match the one you have.
As of 1.3.3, the Hadoop Connector supports UUIDs generated by the MongoDB Java Driver, or any UUID made to be compatible with the Java driver (an example in the Python driver). For more details, see JAVA-403 in the MongoDB Jira project.
This Exception usually indicates that the connector or Java driver jars aren't being picked up correctly. Consult this checklist for easy debugging:
-
mongo-hadoop-core.jar
andmongo-java-driver.jar
are on Hadoop'sCLASSPATH
and Hive/Pig/Spark'sCLASSPATH
. -
Application-specific jars are on Hadoop's
CLASSPATH
(e.g.,mongo-hadoop-hive.jar
) and Hive/Pig/Spark'sCLASSPATH
. -
You have at least 3.0.0+ of the MongoDB Java Driver. Make sure that you have the "uber" jar (called
mongo-java-driver.jar
, notmongodb-driver.jar
). -
You do not have other Java driver artifacts on any of your
CLASSPATH
s. For example:mongodb-driver.jar
bson.jar
mongodb-driver-core.jar