Hello,
I have a query that I am attempting to use the adhoc
flag with the following query:
val statement =
s"""
|SELECT meta().id as topic, array_count(m.subscribers) as subscriberCount
|FROM $CURRENT_BUCKET_IDENTIFIER m
|USE KEYS ${"$1"}""".stripMargin
N1qlQuery.parameterized(statement, JsonArray.from(JsonArray.from(List("1","2","3").asJava)), n1qlParams.maxParallelism(4).adhoc(false))
However I am getting the following error:
Caused by: com.couchbase.client.core.CouchbaseException: N1qlQuery Error - {"msg":"Unable to add name: duplicate name: df627095ff69bbb205fa1a69575eb6483059e0ac","code":4060}
at com.couchbase.client.java.query.core.N1qlQueryExecutor$11$4.call(N1qlQueryExecutor.java:513)
at com.couchbase.client.java.query.core.N1qlQueryExecutor$11$4.call(N1qlQueryExecutor.java:508)
at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
at rx.internal.operators.NotificationLite.accept(NotificationLite.java:135)
at rx.internal.operators.OperatorOnBackpressureBuffer$BufferSubscriber.accept(OperatorOnBackpressureBuffer.java:156)
at rx.internal.util.BackpressureDrainManager.drain(BackpressureDrainManager.java:198)
at rx.internal.operators.OperatorOnBackpressureBuffer$BufferSubscriber.onNext(OperatorOnBackpressureBuffer.java:151)
at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
at rx.internal.operators.NotificationLite.accept(NotificationLite.java:135)
... 41 common frames omitted
Is it not possible to use the adhoc
with the USE KEYS
clause? Things work fine when I set adhoc
to true
.
Thanks,
K