Databricks Lakebase Query

Databricks Lakebase Query

Certified

Run a SQL query on Databricks Lakebase

Mints a short-lived OAuth database credential via the Databricks SDK, then executes a single SQL statement against Lakebase over the Postgres wire protocol. Use fetchType to control how rows are returned: FETCH (all rows in memory), FETCH_ONE (first row), STORE (Ion file in internal storage), or NONE (execute only).

yaml
type: io.kestra.plugin.databricks.lakebase.Query

Run a query against a Lakebase database

yaml
id: lakebase_query
namespace: company.team

tasks:
  - id: query_orders
    type: io.kestra.plugin.databricks.lakebase.Query
    workspaceHost: "{{ secret('DATABRICKS_HOST') }}"
    clientId: "{{ secret('DATABRICKS_CLIENT_ID') }}"
    clientSecret: "{{ secret('DATABRICKS_CLIENT_SECRET') }}"
    endpoint: "{{ secret('LAKEBASE_ENDPOINT_NAME') }}"
    database: "orders_db"
    sql: "SELECT id, status, updated_at FROM orders WHERE status = 'pending'"
    fetchType: FETCH
Properties

OAuth M2M client ID

Service principal client ID (UUID). Also used as the Postgres username when connecting to Lakebase.

OAuth M2M client secret

Service principal OAuth secret used to mint a short-lived Lakebase database credential. Render from secrets.

Postgres database name

Database to open after authentication, e.g. databricks_postgres or orders_db

Lakebase endpoint resource name

Passed to generateDatabaseCredential. Format: projects//branches//endpoints/

SQL query to execute

Single SQL statement rendered with flow variables before execution

Databricks workspace host

Workspace URL used by the Databricks SDK to mint a Lakebase database credential, e.g. https://.cloud.databricks.com

SQL to execute after the main query in the same transaction

Optional single statement, useful for marking processed rows. Committed together with the main query.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Default10000

JDBC fetch size for STORE mode

Number of rows fetched per database round trip when fetchType is STORE. Default: 10000

DefaultFETCH
Possible Values
STOREFETCHFETCH_ONENONE

Result fetching mode

FETCH returns all rows, FETCH_ONE returns the first row only, STORE streams rows to internal storage (Ion), NONE returns no data. Default: FETCH

Lakebase Postgres hostname

Optional. When omitted, the hostname is resolved from the endpoint via the Databricks Postgres API (status.hosts.host).

Named parameter bindings

Map of parameter names to values. Use : name placeholders in SQL; they are replaced with JDBC ? bindings.

Default5432

Lakebase Postgres port

Defaults to 5432

Defaulttrue

Enable SSL

Lakebase requires SSL. Defaults to true.

SSL client certificate

PEM-encoded client certificate written to a temp file and passed to the Postgres driver as sslcert

SSL client key

PEM-encoded client key written to a temp file and passed to the Postgres driver as sslkey

SSL client key password

DefaultREQUIRE
Possible Values
DISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULL

SSL mode

Postgres sslmode. Defaults to REQUIRE, which is the Lakebase-recommended setting.

SSL root certificate

PEM-encoded CA certificate written to a temp file and passed to the Postgres driver as sslrootcert

Time zone for temporal values

Timezone used when converting date/time columns; defaults to the worker JVM time zone

First fetched row

Present when fetchType is FETCH_ONE

SubTypeobject

Fetched rows

Present when fetchType is FETCH

Number of fetched rows

Formaturi

Result file URI

Internal storage URI of the Ion file when fetchType is STORE

Query result size