From 987234a6429912410c1001e3c815370bc89badc2 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Mon, 12 Oct 2026 02:33:06 +0000 Subject: [PATCH] Add kamelet definition: databricks-source --- kamelet.json | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 kamelet.json diff --git a/kamelet.json b/kamelet.json new file mode 100644 index 0000000..2030019 --- /dev/null +++ b/kamelet.json @@ -0,0 +1,194 @@ +{ + "apiVersion": "camel.apache.org/v1", + "kind": "Kamelet", + "metadata": { + "name": "databricks-source", + "annotations": { + "camel.apache.org/kamelet.support.level": "Preview", + "camel.apache.org/catalog.version": "4.22.1", + "camel.apache.org/kamelet.icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIj4KICA8cGF0aCBmaWxsPSIjRkYzNjIxIiBkPSJNMjAgMEw0MCA4LjI3VjEzLjFMMjAgMjAuNUwwIDEzLjFWOC4yN0wyMCAwWiIvPgogIDxwYXRoIGZpbGw9IiNGRjM2MjEiIGQ9Ik0wIDEzLjFMMjAgMjAuNVYyNi45TDAgMTkuNVYxMy4xWiIvPgogIDxwYXRoIGZpbGw9IiNGRjM2MjEiIGQ9Ik00MCAxMy4xTDIwIDIwLjVWMjYuOUw0MCAxOS41VjEzLjFaIi8+CiAgPHBhdGggZmlsbD0iI0ZGMzYyMSIgZD0iTTAgMTkuNUwyMCAyNi45VjMzLjNMMCAyNS45VjE5LjVaIi8+CiAgPHBhdGggZmlsbD0iI0ZGMzYyMSIgZD0iTTQwIDE5LjVMMjAgMjYuOVYzMy4zTDQwIDI1LjlWMTkuNVoiLz4KICA8cGF0aCBmaWxsPSIjRkYzNjIxIiBkPSJNMCAyNS45TDIwIDMzLjNWNDBMMCAzMi42VjI1LjlaIi8+CiAgPHBhdGggZmlsbD0iI0ZGMzYyMSIgZD0iTTQwIDI1LjlMMjAgMzMuM1Y0MEw0MCAzMi42VjI1LjlaIi8+Cjwvc3ZnPgo=", + "camel.apache.org/provider": "Apache Software Foundation", + "camel.apache.org/kamelet.group": "SQL", + "camel.apache.org/kamelet.namespace": "Database" + }, + "labels": { + "camel.apache.org/kamelet.type": "source" + } + }, + "spec": { + "definition": { + "title": "Databricks Source", + "description": "Query data from a Databricks Database. For Unity Catalog workspaces, specify catalog and schema parameters.", + "required": [ + "serverHostname", + "httpPath", + "accessToken", + "query" + ], + "type": "object", + "properties": { + "serverHostname": { + "title": "Server Hostname", + "description": "The Databricks server hostname.", + "type": "string", + "example": "adb-1234567890123456.7.azuredatabricks.net" + }, + "serverPort": { + "title": "Server Port", + "description": "The server port for the Databricks data source.", + "type": "string", + "default": 443 + }, + "httpPath": { + "title": "HTTP Path", + "description": "The HTTP path to the Databricks SQL Warehouse or cluster.", + "type": "string", + "example": "/sql/1.0/warehouses/abc123def456" + }, + "accessToken": { + "title": "Access Token", + "description": "The personal access token to access Databricks.", + "type": "string", + "format": "password", + "x-descriptors": [ + "urn:camel:group:credentials" + ] + }, + "query": { + "title": "Query", + "description": "The query to execute against the Databricks Database.", + "type": "string", + "example": "SELECT * FROM accounts" + }, + "extraOptions": { + "title": "Extra Options", + "description": "Additional JDBC connection options (e.g., ConnCatalog=main;ConnSchema=default).", + "type": "string", + "default": "" + }, + "consumedQuery": { + "title": "Consumed Query", + "description": "A query to run on a tuple consumed.", + "type": "string", + "example": "DELETE FROM accounts where user_id = :#user_id" + }, + "delay": { + "title": "Delay", + "description": "The number of milliseconds before the next poll from the Databricks database.", + "type": "integer", + "default": 500 + } + } + }, + "types": { + "out": { + "mediaType": "application/json" + } + }, + "dependencies": [ + "camel:jackson", + "camel:kamelet", + "camel:sql", + "mvn:com.databricks:databricks-jdbc:3.4.2", + "mvn:org.apache.commons:commons-dbcp2:2.14.0" + ], + "template": { + "beans": [ + { + "name": "local-sql-databricks-source", + "type": "#class:org.apache.camel.component.sql.SqlComponent", + "properties": { + "autowiredEnabled": "false" + } + }, + { + "name": "dsBean", + "type": "#class:org.apache.commons.dbcp2.BasicDataSource", + "properties": { + "password": "{{accessToken}}", + "url": "jdbc:databricks://{{serverHostname}}:{{serverPort}};httpPath={{httpPath}};AuthMech=3;transportMode=http;ssl=1;UID=token;PWD={{accessToken}}{{extraOptions}}", + "driverClassName": "com.databricks.client.jdbc.Driver" + } + } + ], + "from": { + "uri": "{{local-sql-databricks-source}}:{{query}}", + "parameters": { + "dataSource": "#bean:{{dsBean}}", + "onConsume": "{{?consumedQuery}}", + "delay": "{{delay}}" + }, + "steps": [ + { + "marshal": { + "json": { + "library": "Jackson" + } + } + }, + { + "to": "kamelet:sink" + } + ] + } + } + }, + "propertiesSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "title": "Databricks Source", + "description": "Query data from a Databricks Database. For Unity Catalog workspaces, specify catalog and schema parameters.", + "required": [ + "serverHostname", + "httpPath", + "accessToken", + "query" + ], + "properties": { + "serverHostname": { + "type": "string", + "title": "Server Hostname", + "description": "The Databricks server hostname." + }, + "serverPort": { + "type": "string", + "title": "Server Port", + "description": "The server port for the Databricks data source.", + "default": 443 + }, + "httpPath": { + "type": "string", + "title": "HTTP Path", + "description": "The HTTP path to the Databricks SQL Warehouse or cluster." + }, + "accessToken": { + "type": "string", + "title": "Access Token", + "description": "The personal access token to access Databricks.", + "format": "password" + }, + "query": { + "type": "string", + "title": "Query", + "description": "The query to execute against the Databricks Database." + }, + "extraOptions": { + "type": "string", + "title": "Extra Options", + "description": "Additional JDBC connection options (e.g., ConnCatalog=main;ConnSchema=default).", + "default": "" + }, + "consumedQuery": { + "type": "string", + "title": "Consumed Query", + "description": "A query to run on a tuple consumed." + }, + "delay": { + "type": "integer", + "title": "Delay", + "description": "The number of milliseconds before the next poll from the Databricks database.", + "default": 500 + } + } + } +} \ No newline at end of file