Couchbase 6.0.1 is setup successfully in a one-node cluster and is up and running.
I am trying to connect to this cluster from spark shell of edge node having following config -
Spark 2.4.0-cdh6.2.1 Scala version 2.11.12
Below are the commands including errors -
$spark-shell --conf “spark.driver.extraJavaOptions=-Dhttp.proxyHost=<proxy_name> -Dhttp.proxyPort=80” --packages com.couchbase.client:spark-connector_2.12:2.4.0 --conf spark.couchbase.nodes=<node_name> --conf spark.couchbase.username=root --conf spark.couchbase.password= --conf “spark.couchbase.bucket.travel-sample=”
scala> import com.couchbase.spark._
import com.couchbase.spark._
scala> import com.couchbase.spark.sql._
import com.couchbase.spark.sql._
scala> import com.couchbase.client.java.document.JsonDocument
import com.couchbase.client.java.document.JsonDocument
scala> import com.couchbase.client.java.document.json.{JsonArray, JsonObject}
import com.couchbase.client.java.document.json.{JsonArray, JsonObject}
scala> import com.couchbase.client.java.query.N1qlQuery
import com.couchbase.client.java.query.N1qlQuery
scala> import com.couchbase.client.java.view.ViewQuery
import com.couchbase.client.java.view.ViewQuery
scala> val airlines = spark.read.couchbase(schemaFilter = org.apache.spark.sql.sources.EqualTo(“type”, “airline”))
java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
at com.couchbase.spark.sql.N1QLRelation$.attrToFilter(N1QLRelation.scala:223)
at com.couchbase.spark.sql.N1QLRelation$.filterToExpression(N1QLRelation.scala:182)
at com.couchbase.spark.sql.DataFrameReaderFunctions.$anonfun$buildFrame$1(DataFrameReaderFunctions.scala:81)
at scala.Option.map(Option.scala:146)
at com.couchbase.spark.sql.DataFrameReaderFunctions.buildFrame(DataFrameReaderFunctions.scala:81)
at com.couchbase.spark.sql.DataFrameReaderFunctions.couchbase(DataFrameReaderFunctions.scala:61)
… 53 elided
scala> sc.couchbaseGet[JsonDocument](Seq(“airline_10123”, “airline_10748”)).collect().foreach(println)
java.lang.NoSuchMethodError: scala.Product.init(Lscala/Product;)V
at com.couchbase.spark.connection.Credential.(CouchbaseConfig.scala:21)
at com.couchbase.spark.connection.CouchbaseConfig$.apply(CouchbaseConfig.scala:96)
at com.couchbase.spark.rdd.KeyValueRDD.(KeyValueRDD.scala:48)
at com.couchbase.spark.SparkContextFunctions.couchbaseGet(SparkContextFunctions.scala:35)
… 53 elided
scala> sc.couchbaseView(ViewQuery.from(“airlines”, “by_name”).limit(10)).collect().foreach(println)
java.lang.NoSuchMethodError: scala.Product.init(Lscala/Product;)V
at com.couchbase.spark.connection.Credential.(CouchbaseConfig.scala:21)
at com.couchbase.spark.connection.CouchbaseConfig$.apply(CouchbaseConfig.scala:96)
at com.couchbase.spark.rdd.ViewRDD.(ViewRDD.scala:31)
at com.couchbase.spark.rdd.ViewRDD$.apply(ViewRDD.scala:44)
at com.couchbase.spark.SparkContextFunctions.couchbaseView(SparkContextFunctions.scala:73)
… 53 elided
scala>
If this is due to version incompatibility of Scala 2.11 for Spark 2.4 Connector, please provide me the coordinates of a connector version that works with the Spark2.4 and Scala 2.11 ( configurations provided at the beginning and below as well ).
Else kindly confirm that there is no Spark connector that is compatible with the configuration -
Spark 2.4.0-cdh6.2.1 Scala version 2.11.12
Thanks