This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new f9d71864f chore: the Snowflake Kamelets can choose the warehouse, 
schema and role of the session (#3170) (#3237)
f9d71864f is described below

commit f9d71864face7a6b6278d70df56ded0526727c2a
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 18 22:39:16 2026 +0100

    chore: the Snowflake Kamelets can choose the warehouse, schema and role of 
the session (#3170) (#3237)
    
    snowflake-source and snowflake-sink take three new optional options,
    warehouse, schema and role. They are set on the Snowflake data source bean
    (setWarehouse, setSchema, setRole of snowflake-jdbc 4.3.4), and the driver
    sends them with each login as the warehouse, schemaName and roleName
    parameters of the login request. When they are unset, the login request is
    the same as on main, and the defaults of the Snowflake user apply.
    
    The pool settings of the other SQL Kamelets (maxTotal, maxIdle,
    maxWaitMillis) are left out: the Snowflake bean is the driver's
    SnowflakeBasicDataSource, not a commons-dbcp2 BasicDataSource, and does not
    pool. Each message of the sink and each poll of the source logs in again;
    the descriptions now say so.
    
    mongodb-changes-stream-source gets no new option. camel-mongodb resumes a
    change stream after a restart only through changeStreamTokenRepository, a
    StateRepository object, which a Kamelet cannot create only when asked.
    persistentTailTracking is used only by the tailable cursor consumer, and
    changeStreamToken is a fixed start that replays the same changes on every
    start. The description and the partial page now say that changes made while
    the Kamelet is stopped are never sent, and that the collection must exist
    when it starts.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../mongodb-changes-stream-source-description.adoc |  9 ++++++
 .../ROOT/partials/snowflake-sink-description.adoc  | 32 +++++++++++++++++++
 .../partials/snowflake-source-description.adoc     | 36 ++++++++++++++++++++++
 .../mongodb-changes-stream-source.kamelet.yaml     |  2 +-
 kamelets/snowflake-sink.kamelet.yaml               | 20 +++++++++++-
 kamelets/snowflake-source.kamelet.yaml             | 20 +++++++++++-
 .../main/resources/META-INF/kamelets-index.json    |  6 ++--
 .../mongodb-changes-stream-source.kamelet.yaml     |  2 +-
 .../resources/kamelets/snowflake-sink.kamelet.yaml | 20 +++++++++++-
 .../kamelets/snowflake-source.kamelet.yaml         | 20 +++++++++++-
 10 files changed, 158 insertions(+), 9 deletions(-)

diff --git 
a/docs/modules/ROOT/partials/mongodb-changes-stream-source-description.adoc 
b/docs/modules/ROOT/partials/mongodb-changes-stream-source-description.adoc
index be27b7751..07c91e179 100644
--- a/docs/modules/ROOT/partials/mongodb-changes-stream-source-description.adoc
+++ b/docs/modules/ROOT/partials/mongodb-changes-stream-source-description.adoc
@@ -15,6 +15,15 @@ The Kamelet watches a collection with a MongoDB change 
stream, and sends one mes
 
 Change streams need a replica set or a sharded cluster.
 
+=== Restarts
+
+The Kamelet does not save where it stopped. Each time it starts, it sends only 
the changes made from then on, so the
+changes made while it is stopped, such as during a restart or an upgrade, are 
never sent. A system that must not miss a
+change has to catch up from the collection itself after a restart.
+
+The collection must exist when the Kamelet starts. Otherwise the Kamelet fails 
to start with
+`Collection ... does not exist on the database and createCollection is false`.
+
 === The document of an update
 
 MongoDB records an update as the fields that changed, not as the document. The 
`fullDocument` option says what the
diff --git a/docs/modules/ROOT/partials/snowflake-sink-description.adoc 
b/docs/modules/ROOT/partials/snowflake-sink-description.adoc
index 7bed7d3cb..00dbb4eba 100644
--- a/docs/modules/ROOT/partials/snowflake-sink-description.adoc
+++ b/docs/modules/ROOT/partials/snowflake-sink-description.adoc
@@ -22,6 +22,38 @@ The Kamelet logs in to Snowflake as the Snowflake user 
`username`, either with `
 
 Snowflake's guide to 
https://docs.snowflake.com/en/user-guide/key-pair-auth[key-pair authentication] 
shows how to make the key pair, such as with `openssl genrsa 2048 | openssl 
pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt`, and how to set the public 
key on the user with `ALTER USER ... SET RSA_PUBLIC_KEY`.
 
+=== Warehouse, Schema and Role
+
+The Kamelet sends these with each login, so the session starts with them:
+
+- `warehouse`: the virtual warehouse that runs the statements, such as 
`COMPUTE_WH`.
+- `schema`: the schema of `databaseName` that holds the tables, such as 
`SALES`.
+- `role`: the role to run the statements as. It must be granted to the user.
+
+When one is not set, the default of the user applies, as set with `ALTER USER 
... SET DEFAULT_WAREHOUSE`,
+`DEFAULT_NAMESPACE` or `DEFAULT_ROLE`. A user with no default warehouse needs 
`warehouse`, since an INSERT, an UPDATE
+or a DELETE needs a running warehouse.
+
+[source,yaml,subs='+attributes,macros']
+----
+- to:
+    uri: "kamelet:snowflake-sink"
+    parameters:
+      instanceUrl: "myorg-myaccount.snowflakecomputing.com"
+      username: "ORDERS_SERVICE"
+      privateKey: "{{snowflake.private.key}}"
+      databaseName: "SHOP"
+      schema: "SALES"
+      warehouse: "LOAD_WH"
+      role: "ORDERS_LOADER"
+      query: "INSERT INTO orders (id,customer) VALUES (:#id,:#customer)"
+----
+
+=== Connections
+
+The Kamelet keeps no connection to Snowflake open between messages: each 
message logs in again, and starts a new
+session.
+
 === Data Processing
 
 Processes JSON input data through unmarshalling before executing SQL queries. 
This enables seamless integration with JSON-based data pipelines and streaming 
applications.
diff --git a/docs/modules/ROOT/partials/snowflake-source-description.adoc 
b/docs/modules/ROOT/partials/snowflake-source-description.adoc
index 514827895..6addc3d1a 100644
--- a/docs/modules/ROOT/partials/snowflake-source-description.adoc
+++ b/docs/modules/ROOT/partials/snowflake-source-description.adoc
@@ -20,6 +20,7 @@ The Kamelet requires database connection parameters:
 
 - `instanceUrl`: the host name of your Snowflake account, such as 
`myorg-myaccount.snowflakecomputing.com`
 - `databaseName` (optional): the Snowflake database that holds the tables
+- `schema`, `warehouse` and `role` (optional): the schema of `databaseName` 
that holds the tables, the virtual warehouse that runs the queries, and the 
role to run them as. See below.
 - `username`: the Snowflake user to log in as, with `password`, or with a key 
pair in `privateKey` or `privateKeyFile`
 - `query`: the SQL query to run, such as `SELECT * FROM accounts WHERE 
processed = false`
 - `consumedQuery` (optional): an SQL statement run for each row once it is 
sent, to mark the row as read or delete it, such as `UPDATE accounts SET 
processed = true WHERE id = :#id`
@@ -45,6 +46,41 @@ The route below logs each account that is not processed yet, 
and marks it as pro
             uri: "kamelet:log-sink"
 ----
 
+=== Warehouse, Schema and Role
+
+The Kamelet sends these with each login, so the session starts with them:
+
+- `warehouse`: the virtual warehouse that runs the queries, such as 
`COMPUTE_WH`.
+- `schema`: the schema of `databaseName` that holds the tables, such as 
`SALES`.
+- `role`: the role to run the queries as. It must be granted to the user.
+
+When one is not set, the default of the user applies, as set with `ALTER USER 
... SET DEFAULT_WAREHOUSE`,
+`DEFAULT_NAMESPACE` or `DEFAULT_ROLE`. A user with no default warehouse needs 
`warehouse` for a query that reads a table.
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "kamelet:snowflake-source"
+      parameters:
+        instanceUrl: "myorg-myaccount.snowflakecomputing.com"
+        username: "ORDERS_SERVICE"
+        privateKeyFile: "/etc/snowflake/rsa_key.p8"
+        databaseName: "SHOP"
+        schema: "SALES"
+        warehouse: "REPORTING_WH"
+        role: "ORDERS_READER"
+        query: "SELECT * FROM accounts WHERE processed = false"
+        consumedQuery: "UPDATE accounts SET processed = true WHERE id = :#id"
+      steps:
+        - to:
+            uri: "kamelet:log-sink"
+----
+
+=== Connections
+
+The Kamelet keeps no connection to Snowflake open between polls: each poll 
logs in again, and starts a new session.
+
 === Example with a Key Pair
 
 The same route, logged in with a key pair. The key file comes from a 
Kubernetes Secret mounted at `/etc/snowflake`, and the passphrase of the key 
from a property.
diff --git a/kamelets/mongodb-changes-stream-source.kamelet.yaml 
b/kamelets/mongodb-changes-stream-source.kamelet.yaml
index 45346e4ab..420d9aea7 100644
--- a/kamelets/mongodb-changes-stream-source.kamelet.yaml
+++ b/kamelets/mongodb-changes-stream-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is JSON text. For an insert or a replace, it is the 
whole new document. For an update, it is the whole document as it is when the 
change is sent, read again from the collection, so it can already hold later 
changes, and it is the text `null` when the document was deleted meanwhile; 
`fullDocument` changes this. For a delete, it is an object with only the `_id` 
of the deleted document. The `CamelMongoDbStreamOperationType` header says what 
happened (`insert`, `update [...]
 
-      Good to know: only changes made after the Kamelet starts are sent. 
Reading the document again costs MongoDB one more read for each update; set 
`fullDocument` to `default` to send `null` for an update instead. MongoDB 
offers change streams only on a replica set or a sharded cluster, not on a 
single standalone server. Set either `hosts` or `connectionString`. With 
`hosts`, it connects with TLS by default; set `ssl` to false for a MongoDB 
without TLS, such as a local one. With `connec [...]
+      Good to know: only changes made after the Kamelet starts are sent. It 
does not save where it stopped, so the changes made while it is stopped, such 
as during a restart, are never sent. The collection must exist when the Kamelet 
starts; otherwise it fails to start with `Collection ... does not exist on the 
database`. Reading the document again costs MongoDB one more read for each 
update; set `fullDocument` to `default` to send `null` for an update instead. 
MongoDB offers change stre [...]
     required:
       - collection
       - database
diff --git a/kamelets/snowflake-sink.kamelet.yaml 
b/kamelets/snowflake-sink.kamelet.yaml
index 5fccd181e..fdac4f04a 100644
--- a/kamelets/snowflake-sink.kamelet.yaml
+++ b/kamelets/snowflake-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the body afterwards is the JSON object as a Map, and the 
`CamelSqlUpdateCount` header holds the number of rows the statement changed. 
When `query` is a SELECT, the body is instead a List of the rows found, each a 
Map, and the `CamelSqlRowCount` header holds their number.
 
-      Good to know: a message fails when its body is not a JSON object (a JSON 
array or plain text, for example), or when it has no value for a parameter of 
`query`. The values are sent to the database apart from the SQL text, so the 
content of a message cannot change the statement. Do not write `?` in `query`, 
not even in a quoted string: the Kamelet then fails to start. Log in with 
`password`, or with a key pair in `privateKey` or `privateKeyFile`: a Snowflake 
user of type SERVICE, mea [...]
+      Good to know: a message fails when its body is not a JSON object (a JSON 
array or plain text, for example), or when it has no value for a parameter of 
`query`. The values are sent to the database apart from the SQL text, so the 
content of a message cannot change the statement. Do not write `?` in `query`, 
not even in a quoted string: the Kamelet then fails to start. Log in with 
`password`, or with a key pair in `privateKey` or `privateKeyFile`: a Snowflake 
user of type SERVICE, mea [...]
     required:
       - instanceUrl
       - username
@@ -93,6 +93,21 @@ spec:
         description: The Snowflake database that holds the tables `query` 
names.
         type: string
         example: SHOP
+      schema:
+        title: Schema
+        description: The schema of `databaseName` that holds the tables 
`query` names, such as `PUBLIC`. When it is not set, the default of the user 
applies. A table of another schema can still be named in full in `query`, as 
`SCHEMA.TABLE`.
+        type: string
+        example: SALES
+      warehouse:
+        title: Warehouse
+        description: The Snowflake virtual warehouse that runs the statements. 
When it is not set, the default warehouse of the user `username` is used, as 
set with `ALTER USER ... SET DEFAULT_WAREHOUSE`. With neither, a statement that 
needs a warehouse, such as an INSERT, fails.
+        type: string
+        example: COMPUTE_WH
+      role:
+        title: Role
+        description: The Snowflake role to run the statements as, which must 
be granted to the user `username`. When it is not set, the default role of the 
user is used, as set with `ALTER USER ... SET DEFAULT_ROLE`.
+        type: string
+        example: LOADER
   types:
     in:
       mediaType: application/json
@@ -127,6 +142,9 @@ spec:
           password: "{{password:}}"
           url: "jdbc:snowflake://{{instanceUrl}}"
           databaseName: "{{?databaseName}}"
+          schema: "{{?schema}}"
+          warehouse: "{{?warehouse}}"
+          role: "{{?role}}"
           properties[private_key_base64]: "{{?privateKey}}"
           properties[private_key_file]: "{{?privateKeyFile}}"
           properties[private_key_pwd]: "{{?privateKeyPassphrase}}"
diff --git a/kamelets/snowflake-source.kamelet.yaml 
b/kamelets/snowflake-source.kamelet.yaml
index c7621d8ec..7e186390d 100644
--- a/kamelets/snowflake-source.kamelet.yaml
+++ b/kamelets/snowflake-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is one row as JSON text, an object with the column 
names as keys, such as `{"id":1,"username":"oscerd","city":"Rome"}`. The 
`Content-Type` header is `application/json`.
 
-      Good to know: the query runs again `delay` milliseconds after the 
previous run, so the same rows are sent again and again, unless `consumedQuery` 
marks or deletes each row once it is sent and `query` leaves such rows out: for 
example `SELECT * FROM accounts WHERE processed = false` with `UPDATE accounts 
SET processed = true WHERE id = :#id`. When the next step fails for a row, 
`consumedQuery` is not run for it, and the row is read again. A query that 
finds no rows sends nothing. `q [...]
+      Good to know: the query runs again `delay` milliseconds after the 
previous run, so the same rows are sent again and again, unless `consumedQuery` 
marks or deletes each row once it is sent and `query` leaves such rows out: for 
example `SELECT * FROM accounts WHERE processed = false` with `UPDATE accounts 
SET processed = true WHERE id = :#id`. When the next step fails for a row, 
`consumedQuery` is not run for it, and the row is read again. A query that 
finds no rows sends nothing. `q [...]
     required:
       - instanceUrl
       - username
@@ -91,6 +91,21 @@ spec:
         description: The Snowflake database that holds the tables `query` 
names.
         type: string
         example: SHOP
+      schema:
+        title: Schema
+        description: The schema of `databaseName` that holds the tables 
`query` names, such as `PUBLIC`. When it is not set, the default of the user 
applies. A table of another schema can still be named in full in `query`, as 
`SCHEMA.TABLE`.
+        type: string
+        example: SALES
+      warehouse:
+        title: Warehouse
+        description: The Snowflake virtual warehouse that runs the queries. 
When it is not set, the default warehouse of the user `username` is used, as 
set with `ALTER USER ... SET DEFAULT_WAREHOUSE`. With neither, a query that 
needs a warehouse fails.
+        type: string
+        example: COMPUTE_WH
+      role:
+        title: Role
+        description: The Snowflake role to run the queries as, which must be 
granted to the user `username`. When it is not set, the default role of the 
user is used, as set with `ALTER USER ... SET DEFAULT_ROLE`.
+        type: string
+        example: READER
       consumedQuery:
         title: Consumed Query
         description: An SQL statement to run after each row has been sent on, 
to mark the row as read or to delete it, so that `query` does not return it 
again. Write `:#column` where the value of a column of that row goes, such as 
`:#id`. When it is not set, nothing is changed, and the same rows are read on 
every poll.
@@ -131,6 +146,9 @@ spec:
           password: "{{password:}}"
           url: "jdbc:snowflake://{{instanceUrl}}"
           databaseName: "{{?databaseName}}"
+          schema: "{{?schema}}"
+          warehouse: "{{?warehouse}}"
+          role: "{{?role}}"
           properties[private_key_base64]: "{{?privateKey}}"
           properties[private_key_file]: "{{?privateKeyFile}}"
           properties[private_key_pwd]: "{{?privateKeyPassphrase}}"
diff --git 
a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json 
b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
index dfda5211d..ab023c6e2 100644
--- a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
+++ b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
@@ -1545,7 +1545,7 @@
     "supportLevel" : "Stable",
     "title" : "MongoDB Changes Stream Source",
     "summary" : "Sends a message for each change to a collection of a MongoDB 
database, such as a document inserted, updated or deleted, as it happens.",
-    "description" : "Sends a message for each change to a collection of a 
MongoDB database, such as a document inserted, updated or deleted, as it 
happens.\n\nUse it to react to changes in MongoDB, for example to copy new 
orders to another system or to keep a cache or a search index up to date. To 
read the documents of a capped collection from the start, use `mongodb-source`. 
To write documents, use `mongodb-sink`.\n\nOutput: the body is JSON text. For 
an insert or a replace, it is the w [...]
+    "description" : "Sends a message for each change to a collection of a 
MongoDB database, such as a document inserted, updated or deleted, as it 
happens.\n\nUse it to react to changes in MongoDB, for example to copy new 
orders to another system or to keep a cache or a search index up to date. To 
read the documents of a capped collection from the start, use `mongodb-source`. 
To write documents, use `mongodb-sink`.\n\nOutput: the body is JSON text. For 
an insert or a replace, it is the w [...]
     "group" : "MongoDB",
     "namespace" : "Nosql",
     "provider" : "Apache Software Foundation"
@@ -2065,7 +2065,7 @@
     "supportLevel" : "Preview",
     "title" : "Snowflake Sink",
     "summary" : "Runs an SQL statement, such as an INSERT, in a Snowflake 
database for each message, with values taken from the fields of the JSON object 
in the body.",
-    "description" : "Runs an SQL statement, such as an INSERT, in a Snowflake 
database for each message, with values taken from the fields of the JSON object 
in the body.\n\nUse it to store records from another system as rows of a table, 
such as each order that arrives on a Kafka topic, or to update or delete rows. 
To read rows, use `snowflake-source`.\n\nInput: the body is one JSON object, as 
text, such as `{\"username\":\"oscerd\",\"city\":\"Rome\"}`. In `query`, write 
`:#username` whe [...]
+    "description" : "Runs an SQL statement, such as an INSERT, in a Snowflake 
database for each message, with values taken from the fields of the JSON object 
in the body.\n\nUse it to store records from another system as rows of a table, 
such as each order that arrives on a Kafka topic, or to update or delete rows. 
To read rows, use `snowflake-source`.\n\nInput: the body is one JSON object, as 
text, such as `{\"username\":\"oscerd\",\"city\":\"Rome\"}`. In `query`, write 
`:#username` whe [...]
     "group" : "SQL",
     "namespace" : "Database",
     "provider" : "Apache Software Foundation"
@@ -2075,7 +2075,7 @@
     "supportLevel" : "Preview",
     "title" : "Snowflake Source",
     "summary" : "Runs an SQL query in a Snowflake database again and again, 
and sends each row it returns as a message, as a JSON object.",
-    "description" : "Runs an SQL query in a Snowflake database again and 
again, and sends each row it returns as a message, as a JSON object.\n\nUse it 
to pick up the rows that another application adds to a table, such as new 
orders or events, and pass them on to another system. To write rows, use 
`snowflake-sink`.\n\nOutput: the body is one row as JSON text, an object with 
the column names as keys, such as 
`{\"id\":1,\"username\":\"oscerd\",\"city\":\"Rome\"}`. The `Content-Type` 
header [...]
+    "description" : "Runs an SQL query in a Snowflake database again and 
again, and sends each row it returns as a message, as a JSON object.\n\nUse it 
to pick up the rows that another application adds to a table, such as new 
orders or events, and pass them on to another system. To write rows, use 
`snowflake-sink`.\n\nOutput: the body is one row as JSON text, an object with 
the column names as keys, such as 
`{\"id\":1,\"username\":\"oscerd\",\"city\":\"Rome\"}`. The `Content-Type` 
header [...]
     "group" : "SQL",
     "namespace" : "Database",
     "provider" : "Apache Software Foundation"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/mongodb-changes-stream-source.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/mongodb-changes-stream-source.kamelet.yaml
index 45346e4ab..420d9aea7 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/mongodb-changes-stream-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/mongodb-changes-stream-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is JSON text. For an insert or a replace, it is the 
whole new document. For an update, it is the whole document as it is when the 
change is sent, read again from the collection, so it can already hold later 
changes, and it is the text `null` when the document was deleted meanwhile; 
`fullDocument` changes this. For a delete, it is an object with only the `_id` 
of the deleted document. The `CamelMongoDbStreamOperationType` header says what 
happened (`insert`, `update [...]
 
-      Good to know: only changes made after the Kamelet starts are sent. 
Reading the document again costs MongoDB one more read for each update; set 
`fullDocument` to `default` to send `null` for an update instead. MongoDB 
offers change streams only on a replica set or a sharded cluster, not on a 
single standalone server. Set either `hosts` or `connectionString`. With 
`hosts`, it connects with TLS by default; set `ssl` to false for a MongoDB 
without TLS, such as a local one. With `connec [...]
+      Good to know: only changes made after the Kamelet starts are sent. It 
does not save where it stopped, so the changes made while it is stopped, such 
as during a restart, are never sent. The collection must exist when the Kamelet 
starts; otherwise it fails to start with `Collection ... does not exist on the 
database`. Reading the document again costs MongoDB one more read for each 
update; set `fullDocument` to `default` to send `null` for an update instead. 
MongoDB offers change stre [...]
     required:
       - collection
       - database
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/snowflake-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/snowflake-sink.kamelet.yaml
index 5fccd181e..fdac4f04a 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/snowflake-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/snowflake-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the body afterwards is the JSON object as a Map, and the 
`CamelSqlUpdateCount` header holds the number of rows the statement changed. 
When `query` is a SELECT, the body is instead a List of the rows found, each a 
Map, and the `CamelSqlRowCount` header holds their number.
 
-      Good to know: a message fails when its body is not a JSON object (a JSON 
array or plain text, for example), or when it has no value for a parameter of 
`query`. The values are sent to the database apart from the SQL text, so the 
content of a message cannot change the statement. Do not write `?` in `query`, 
not even in a quoted string: the Kamelet then fails to start. Log in with 
`password`, or with a key pair in `privateKey` or `privateKeyFile`: a Snowflake 
user of type SERVICE, mea [...]
+      Good to know: a message fails when its body is not a JSON object (a JSON 
array or plain text, for example), or when it has no value for a parameter of 
`query`. The values are sent to the database apart from the SQL text, so the 
content of a message cannot change the statement. Do not write `?` in `query`, 
not even in a quoted string: the Kamelet then fails to start. Log in with 
`password`, or with a key pair in `privateKey` or `privateKeyFile`: a Snowflake 
user of type SERVICE, mea [...]
     required:
       - instanceUrl
       - username
@@ -93,6 +93,21 @@ spec:
         description: The Snowflake database that holds the tables `query` 
names.
         type: string
         example: SHOP
+      schema:
+        title: Schema
+        description: The schema of `databaseName` that holds the tables 
`query` names, such as `PUBLIC`. When it is not set, the default of the user 
applies. A table of another schema can still be named in full in `query`, as 
`SCHEMA.TABLE`.
+        type: string
+        example: SALES
+      warehouse:
+        title: Warehouse
+        description: The Snowflake virtual warehouse that runs the statements. 
When it is not set, the default warehouse of the user `username` is used, as 
set with `ALTER USER ... SET DEFAULT_WAREHOUSE`. With neither, a statement that 
needs a warehouse, such as an INSERT, fails.
+        type: string
+        example: COMPUTE_WH
+      role:
+        title: Role
+        description: The Snowflake role to run the statements as, which must 
be granted to the user `username`. When it is not set, the default role of the 
user is used, as set with `ALTER USER ... SET DEFAULT_ROLE`.
+        type: string
+        example: LOADER
   types:
     in:
       mediaType: application/json
@@ -127,6 +142,9 @@ spec:
           password: "{{password:}}"
           url: "jdbc:snowflake://{{instanceUrl}}"
           databaseName: "{{?databaseName}}"
+          schema: "{{?schema}}"
+          warehouse: "{{?warehouse}}"
+          role: "{{?role}}"
           properties[private_key_base64]: "{{?privateKey}}"
           properties[private_key_file]: "{{?privateKeyFile}}"
           properties[private_key_pwd]: "{{?privateKeyPassphrase}}"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/snowflake-source.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/snowflake-source.kamelet.yaml
index c7621d8ec..7e186390d 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/snowflake-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/snowflake-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is one row as JSON text, an object with the column 
names as keys, such as `{"id":1,"username":"oscerd","city":"Rome"}`. The 
`Content-Type` header is `application/json`.
 
-      Good to know: the query runs again `delay` milliseconds after the 
previous run, so the same rows are sent again and again, unless `consumedQuery` 
marks or deletes each row once it is sent and `query` leaves such rows out: for 
example `SELECT * FROM accounts WHERE processed = false` with `UPDATE accounts 
SET processed = true WHERE id = :#id`. When the next step fails for a row, 
`consumedQuery` is not run for it, and the row is read again. A query that 
finds no rows sends nothing. `q [...]
+      Good to know: the query runs again `delay` milliseconds after the 
previous run, so the same rows are sent again and again, unless `consumedQuery` 
marks or deletes each row once it is sent and `query` leaves such rows out: for 
example `SELECT * FROM accounts WHERE processed = false` with `UPDATE accounts 
SET processed = true WHERE id = :#id`. When the next step fails for a row, 
`consumedQuery` is not run for it, and the row is read again. A query that 
finds no rows sends nothing. `q [...]
     required:
       - instanceUrl
       - username
@@ -91,6 +91,21 @@ spec:
         description: The Snowflake database that holds the tables `query` 
names.
         type: string
         example: SHOP
+      schema:
+        title: Schema
+        description: The schema of `databaseName` that holds the tables 
`query` names, such as `PUBLIC`. When it is not set, the default of the user 
applies. A table of another schema can still be named in full in `query`, as 
`SCHEMA.TABLE`.
+        type: string
+        example: SALES
+      warehouse:
+        title: Warehouse
+        description: The Snowflake virtual warehouse that runs the queries. 
When it is not set, the default warehouse of the user `username` is used, as 
set with `ALTER USER ... SET DEFAULT_WAREHOUSE`. With neither, a query that 
needs a warehouse fails.
+        type: string
+        example: COMPUTE_WH
+      role:
+        title: Role
+        description: The Snowflake role to run the queries as, which must be 
granted to the user `username`. When it is not set, the default role of the 
user is used, as set with `ALTER USER ... SET DEFAULT_ROLE`.
+        type: string
+        example: READER
       consumedQuery:
         title: Consumed Query
         description: An SQL statement to run after each row has been sent on, 
to mark the row as read or to delete it, so that `query` does not return it 
again. Write `:#column` where the value of a column of that row goes, such as 
`:#id`. When it is not set, nothing is changed, and the same rows are read on 
every poll.
@@ -131,6 +146,9 @@ spec:
           password: "{{password:}}"
           url: "jdbc:snowflake://{{instanceUrl}}"
           databaseName: "{{?databaseName}}"
+          schema: "{{?schema}}"
+          warehouse: "{{?warehouse}}"
+          role: "{{?role}}"
           properties[private_key_base64]: "{{?privateKey}}"
           properties[private_key_file]: "{{?privateKeyFile}}"
           properties[private_key_pwd]: "{{?privateKeyPassphrase}}"

Reply via email to