K_Anudeep
Databricks Employee
Databricks Employee

Hey @kahrees ,

Good Day!

I tested this internally, and I was able to reproduce the issue. Screenshot below:

K_Anudeep_0-1762914681450.png

 

You’re getting [DATA_SOURCE_NOT_FOUND] ... mongodb because the MongoDB Spark connector jar isn’t actually on your cluster’s classpath. On Databricks (including Community Edition), setting
spark.jars.packages inside SparkSession.builder usually do not install cluster libraries—the cluster must have the jar pre-installed.

 

  • Install the connector as a cluster library (Libraries → Maven → Install → Restart).

  • Use a connector matching your Scala line (Databricks DBR typically = Scala 2.12 → use _2.12) .Not also check your connectivity from Databricks to mongo before rer-unning

I tested this, and it works locally in my env.

 

 

Anudeep

View solution in original post