For the complete documentation index, see llms.txt. This page is also available as Markdown.

Databricks

Connect & Ingest data from / to a Databricks database

Setup

The following credentials keys are accepted:

  • host (required) -> The hostname of the Databricks workspace (e.g., dbc-a1b2c3d4-e5f6.cloud.databricks.com)

  • token (required) -> The personal access token or password to access the instance

  • warehouse_id (required) -> The SQL warehouse ID to connect to

  • http_path (optional) -> The HTTP path for the connection (if not using warehouse_id)

  • catalog (optional) -> The initial catalog name to use in the session (default: hive_metastore)

  • schema (optional) -> The initial schema name to use in the session (default: default)

  • port (optional) -> The port number (default: 443)

  • max_rows (optional) -> Maximum number of rows fetched per request (default: 10000)

  • internal_volume (optional) -> Specifies a custom internal volume to use for bulk operations. If not provided, Sling will attempt to create a volume in the default schema named SLING_SCHEMA.SLING_STAGING.

  • table_format (optional) -> The table format to use when Sling creates a table. Accepts delta or iceberg (default: delta). See Table Format below.

  • copy_method (optional) -> How Sling bulk-loads into Databricks. stage uses a Unity Catalog volume and COPY INTO (default). aws uses S3. zerobus streams Arrow RecordBatches into a Delta table (Beta). See Zerobus below.

  • timeout (optional) -> Timeout in seconds for server query execution (no timeout by default)

  • user_agent_entry (optional) -> Used to identify partners

  • ansi_mode (optional) -> Boolean for ANSI SQL specification adherence (default: false)

  • timezone (optional) -> Timezone setting (default: UTC)

Using sling conns

Here are examples of setting a connection named DATABRICKS. We must provide the type=databricks property:

Environment Variable

See here to learn more about the .env.sling file.

Sling Env File YAML

See here to learn more about the sling env.yaml file.

Table Format

Sling creates Delta tables by default. To create Managed Iceberg tables instead, set table_format to iceberg on the connection:

Or with sling conns:

The format applies to the tables Sling creates, including the temporary tables used for incremental and backfill modes. All load modes and merge strategies work the same for both formats.

Your workspace must have Managed Iceberg tables enabled in Unity Catalog. Sling does not change the format of a table that already exists.

To control the DDL further, use the table_ddl target option, which overrides table_format:

Zerobus

Set copy_method: zerobus to ingest with Databricks Zerobus instead of staging files. This is still the same type: databricks connection (there is no type: zerobus). The SQL warehouse is used for DESCRIBE, CREATE TABLE, TRUNCATE, and MERGE; Zerobus only streams rows into the Delta table.

This is Beta.

Credentials

On top of host, token, and warehouse_id:

  • copy_method (required for Zerobus) -> zerobus

  • client_id (required) -> OAuth M2M service principal application ID

  • client_secret (required) -> OAuth M2M client secret

  • zerobus_endpoint (optional) -> Zerobus shard URL, not the workspace host. Example: https://<workspace-id>.zerobus.<region>.cloud.databricks.com. On Azure the suffix is azuredatabricks.net; on GCP it is gcp.databricks.com. If omitted, Sling tries to detect it from Unity Catalog.

  • batch_size (optional) -> Rows per Arrow RecordBatch (default: 10000)

  • ipc_compression (optional) -> Arrow IPC compression: none (default), lz4, or zstd

  • max_inflight_batches (optional) -> In-flight batches waiting for acknowledgment (default: 1000)

Create a service principal and secret in the workspace, then grant it access to the target catalog/schema:

See Authorize service principal access to Databricks with OAuth.

Using sling conns

Sling Env File YAML

Zerobus writes Delta tables only. If table_format is iceberg, Sling uses delta for this connection.

If you are facing issues connecting, give sling assist a try, or reach out to us at support@slingdata.io, on discord or open a Github Issue here.

Last updated

Was this helpful?