当前位置:网站首页>Mongodb problem set

Mongodb problem set

2022-07-06 01:26:00 I'm the real number 17

mongo start-up
mongod --dbpath E:\MongoDB\data\db

1:MongoClient、MongoClientURI Red explosion

I tested a lot of dependencies , I don't think it can be solved by dependence , Finally, I got it right , Fierce woman crying .
Add dependency

   <dependencies>
       <dependency>
           <groupId>org.mongodb</groupId>
           <artifactId>casbah-core_2.10</artifactId>
           <version>3.1.1</version>
       </dependency>
   </dependencies>

2:Failed to find data source: com.mongodb.spark.sql

Add dependency

<!-- spark  Connect  mongo The connectors  -->
<dependency>
    <groupId>org.mongodb.spark</groupId>
    <artifactId>mongo-spark-connector_2.11</artifactId>
    <version>2.3.1</version>
</dependency>
 
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-core_2.11</artifactId>
    <version>2.3.1</version>
</dependency>
 
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-sql_2.11</artifactId>
    <version>2.3.1</version>
</dependency>

3:Caused by: java.lang.NumberFormatException: For input string: “movieId”

The data file has impurities , Manual deletion or data preprocessing can be solved
 Insert picture description here

SLF4J: Class path contains multiple SLF4J bindings.

Redundant SLF4J package
Exclude superfluous from dependencies log package

 <dependency>
     <groupId>org.apache.spark</groupId>
     <artifactId>spark-core_2.11</artifactId>
     <version>2.3.1</version>
     <exclusions>
         <exclusion>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
         </exclusion>
     </exclusions>
 </dependency>
原网站

版权声明
本文为[I'm the real number 17]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140126013433.html