Hello,
I am trying to connect to Couchbase in an Azure Databricks (Spark) environment. However, I only see Couchbase Spark connectors for Spark 2.4 and Scala 2.12 OR Spark 2.3 and Scala 2.11.
Databricks only offers runtime environments for Spark 2.4 and Scala 2.11 OR Spark 3.0 and Scala 2.12.
Nevertheless, I have tried using both Couchbase connectors but ran into errors that I believe may be related to the versions differing.
For example, here is the code and error when using the Couchbase connector for Spark 2.4 and Scala 2.12 on a Databricks environment using Spark 2.4 and Scala 2.11 –
import com.couchbase.spark.
import com.couchbase.spark.sql.
import com.couchbase.client.java.document.JsonDocument
import org.apache.spark.sql.sources.EqualTo
import com.couchbase.client.java.query.N1qlQuery
import com.couchbase.client.java.view.ViewQuery
val sc = spark.sparkContext
sc.couchbaseGetJsonDocument.collect().foreach(println)
ERROR: java.lang.NoSuchMethodError: scala.Product.init(Lscala/Product;)V
And here are the spark config variables I’m setting in the databricks cluster –
spark.couchbase.password
spark.couchbase.username
spark.couchbase.nodes
spark.couchbase.bucket <bucket_name>
Our couchbase server is 6.0.1. Does anyone know if this is a version compatibility issue or if I am doing something wrong on my end?
Thank you for any help,
Zack