Thanks.Now it is working. On Thu, Sep 8, 2016 at 12:57 AM, aka.fe2s <aka.f...@gmail.com> wrote:
> Most likely you are missing an import statement that enables some Scala > implicits. I haven't used this connector, but looks like you need "import > com.couchbase.spark._" > > -- > Oleksiy Dyagilev > > On Wed, Sep 7, 2016 at 9:42 AM, Devi P.V <devip2...@gmail.com> wrote: > >> I am newbie in CouchBase.I am trying to write data into CouchBase.My >> sample code is following, >> >> val cfg = new SparkConf() >> .setAppName("couchbaseQuickstart") >> .setMaster("local[*]") >> .set("com.couchbase.bucket.MyBucket","pwd") >> >> val sc = new SparkContext(cfg) >> val doc1 = JsonDocument.create("doc1", JsonObject.create().put("some", >> "content")) >> val doc2 = JsonArrayDocument.create("doc2", JsonArray.from("more", >> "content", "in", "here")) >> >> val data = sc >> .parallelize(Seq(doc1, doc2)) >> >> But I can't access data.saveToCouchbase(). >> >> I am using Spark 1.6.1 & Scala 2.11.8 >> >> I gave following dependencies in built.sbt >> >> libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "1.6.1" >> libraryDependencies += "com.couchbase.client" % "spark-connector_2.11" % >> "1.2.1" >> >> >> How can I write data into CouchBase using Spark & Scala? >> >> >> >> >> >