Member since
07-18-2018
6
Posts
0
Kudos Received
0
Solutions
09-20-2018
10:20 PM
spark2 mongoldb 3.2
... View more
09-18-2018
12:48 PM
guys I am having the following issue trying to query mongo db from zeppelin with spark:
java.lang.IllegalArgumentException: Missing collection name. Set via the 'spark.mongodb.input.uri' or 'spark.mongodb.input.collection' property
I have set mongo-spark-connector_2.11:2.2.2 in dependencies of spark2 interpretator
and my code is: %spark2
import com.mongodb.spark._
spark.conf.set("spark.mongodb.input.uri", "mongodb://myip:myport/mydb.collection")
spark.conf.set("spark.mongodb.output.uri", "mongodb://myip:myport/mydb.collection")
val rdd = MongoSpark.load(sc)
I also tried: %spark2
sc.stop()
import org.apache.spark.sql.SparkSession
import com.mongodb.spark._
import com.mongodb.spark.config._
val spark_custom_session = SparkSession.builder()
.master("local")
.appName("ZeplinMongo")
.config("spark.mongodb.input.database", "mongodb://myip:myport/mydb.collection")
.config("spark.mongodb.output.uri", "mongodb://myip:myport/mydb.collection")
.config("spark.mongodb.output.collection", "mongodb://myip:myport/mydb.collection") .getOrCreate()
val customRdd = MongoSpark.load(spark_custom_session)
rdd.count
And import com.mongodb.spark.config._
val readConfig = ReadConfig(Map(
"spark.mongodb.input.uri" -> "mongodb://myip:myport/mydb.collection",
"spark.mongodb.input.readPreference.name" -> "secondaryPreferred"),
Some(ReadConfig(sc)))
val customRdd = MongoSpark.load(sc, readConfig)
customRdd.count What ever I do I get: import org.apache.spark.sql.SparkSession
import com.mongodb.spark._
import com.mongodb.spark.config._
spark_custom_session: org.apache.spark.sql.SparkSession = org.apache.spark.sql.SparkSession@4f9c7e5f
java.lang.IllegalArgumentException: Missing collection name. Set via the 'spark.mongodb.input.uri' or 'spark.mongodb.input.collection' property
at com.mongodb.spark.config.MongoCompanionConfig$class.collectionName(MongoCompanionConfig.scala:270)
at com.mongodb.spark.config.ReadConfig$.collectionName(ReadConfig.scala:39)
at com.mongodb.spark.config.ReadConfig$.apply(ReadConfig.scala:60)
at com.mongodb.spark.config.ReadConfig$.apply(ReadConfig.scala:39)
at com.mongodb.spark.config.MongoCompanionConfig$class.apply(MongoCompanionConfig.scala:124)
at com.mongodb.spark.config.ReadConfig$.apply(ReadConfig.scala:39)
at com.mongodb.spark.config.MongoCompanionConfig$class.apply(MongoCompanionConfig.scala:113)
at com.mongodb.spark.config.ReadConfig$.apply(ReadConfig.scala:39)
at com.mongodb.spark.MongoSpark$Builder.build(MongoSpark.scala:231)
at com.mongodb.spark.MongoSpark$.load(MongoSpark.scala:84)
... 73 elided PLEASE HELP! 🙂
... View more
07-25-2018
03:20 PM
I am also getting a problem, i cannot save a notebook (HDP 2.6.5) in the zeppelin ui i am getting: "Couldn't checkpoint note revision: possibly storage doesn't support versioning. Please check the logs for more details." in the log i get: "WARN [2018-07-25 15:18:44,757] ({qtp1786364562-1678} FileSystemNotebookRepo.java[checkpoint]:159) - checkpoint is not implemented for HdfsNotebookRepo" (not Kerberized) can any one help?
... View more