Databricks Lakebase Batch

Databricks Lakebase Batch

Certified

Run a parameterized batch against Databricks Lakebase

Mints a short-lived OAuth database credential, then executes a prepared SQL statement once per parameter group or once per row from an Ion file in internal storage. Intended for bulk insert and update workloads.

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

Batch-insert rows produced by an upstream task

yaml
id: lakebase_batch_insert
namespace: company.team

inputs:
  - id: rows
    type: ARRAY
    itemType: STRING

tasks:
  - id: insert_rows
    type: io.kestra.plugin.databricks.lakebase.Batch
    workspaceHost: "{{ secret('DATABRICKS_HOST') }}"
    clientId: "{{ secret('DATABRICKS_CLIENT_ID') }}"
    clientSecret: "{{ secret('DATABRICKS_CLIENT_SECRET') }}"
    endpoint: "{{ secret('LAKEBASE_ENDPOINT_NAME') }}"
    database: "orders_db"
    sql: "INSERT INTO orders_audit (payload) VALUES (?)"
    parameterGroups:
      - parameters: "{{ inputs.rows }}"
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 statement to execute

Prepared statement with JDBC ? placeholders, rendered with flow variables

Databricks workspace host

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

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
Default1000

JDBC batch size

Number of rows added to the prepared statement before executeBatch. Default: 1000

Ion file of rows to bind

Internal storage URI of an Ion file produced by a previous task (for example Query with fetchType STORE). Each row is a map or a list bound to the SQL placeholders.

Lakebase Postgres hostname

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

Parameter groups for the prepared statement

Each group supplies values for one or more executions. A group's parameters may be a single row (a list of values), a list of rows, or — when the SQL has a single placeholder — a list of scalars that each become their own row.

Definitions
parametersobject

Parameter values

A single row (list of values), a list of rows, or — when the SQL has one placeholder — a list of scalars

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

Number of rows processed

Number of rows reported updated by the driver

The number of batch statements executed

The number of records processed

The number of records updated