CouchBase Spark connector SparkSession multiple bucket not work in spark connector 2.2.0 and CB 5.1

With the help of this thread mentioned that “if you open more than one bucket and forget to set the bucket name explicitly” so I changed my query as below :

val query ="select  META(t).id from "+bucketName
  sc.sparkContext
    .couchbaseQuery(N1qlQuery.simple(query), bucketName = bucketName) // Explicitly passed bucket name 
    .map(row=>row.value.getString("id"))
    .distinct()
1 Like