From 7867aab778e20c5ae60b3b71869e8e33a9acee96 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Mon, 7 Sep 2026 10:16:48 +0200 Subject: [PATCH] Fix #542: correct the couchbase-source statement example The example shipped in #3007 -- SELECT * FROM `travel-sample` LIMIT 10 -- does not work, and fails in the worst way: the source polls happily and emits nothing. Two requirements, both found by running the Kamelet against a live cluster while writing the integration test in #3008: CouchbaseConsumer reads row.getString("__id") and skips any row without that field, logging a warning rather than failing. A query that does not alias the document id as __id therefore produces no exchanges at all. The consumer runs the query through scope.query(...), so the keyspace resolves as ._default.. Naming the bucket gives ._default. and fails with "Keyspace not found"; the collection, normally _default, is what belongs there. The example now matches what the integration test actually uses, and the description states both requirements so the next person does not have to rediscover them from a silent no-op. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Tz352mt7yzGWLfvYTBo2Dk --- kamelets/couchbase-source.kamelet.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kamelets/couchbase-source.kamelet.yaml b/kamelets/couchbase-source.kamelet.yaml index 8a80f28f6..c91fb9e31 100644 --- a/kamelets/couchbase-source.kamelet.yaml +++ b/kamelets/couchbase-source.kamelet.yaml @@ -76,9 +76,13 @@ spec: type: string statement: title: N1QL Statement - description: The N1QL query to run against the bucket on each poll. Used unless useView is true. + description: >- + The N1QL query to run against the bucket on each poll. Used unless useView is true. + The query runs in the bucket scope, so the keyspace is the collection - use _default + for the default collection rather than the bucket name. It must also alias the document + id as __id, because rows without that field are skipped. type: string - example: "SELECT * FROM `travel-sample` LIMIT 10" + example: "SELECT META().id AS __id, * FROM _default" useView: title: Use View description: Poll a MapReduce view instead of running the N1QL statement.