Destinations
Databricks
Set up Databricks as an Artie destination: a SQL warehouse, a Unity Catalog volume, and a personal access token or OAuth service principal.
Prerequisites
Have these ready before you add the destination in Artie:
- A Databricks SQL warehouse for Artie to connect to.
- A Unity Catalog catalog and schema for Artie to write to, existing or created during setup.
- A personal access token, or a service principal’s client ID and OAuth secret.
- Workspace admin access, if you use a service principal.
1. Find the SQL warehouse host and HTTP path
- In your Databricks workspace sidebar, select SQL Warehouses.
- Select the warehouse Artie should use.
- Open the Connection details tab.
- Copy Server hostname and HTTP path.
The values are on the Connection details tab:
2. Create a volume
Artie stages temporary files in a volume and deletes them after they load. Each schema Artie writes to needs a volume with the same name. Run this in the Databricks SQL editor:
CREATE VOLUME my_catalog.my_schema.my_volume;Replace my_catalog, my_schema and my_volume with your catalog, schema and volume names. Repeat it for every schema Artie writes to.
Skip this for a schema that Artie creates. Artie creates the volume together with the schema.
3. Create credentials for Artie
Artie accepts one authentication method per destination: a personal access token, or OAuth machine-to-machine (M2M) credentials for a service principal. Artie rejects a destination that has both.
- In your Databricks workspace, select your username in the top bar, then Settings.
- Select Developer.
- Next to Access tokens, select Manage, then Generate new token.
- Name the token and set its lifetime in days.
- Select Generate, copy the token, then select Done.
Databricks shows the token only once. Replace the token in Artie before it expires, so replication keeps running.
As a workspace admin:
- Select your username in the top bar, then Settings.
- Select Identity and access.
- Next to Service principals, select Manage.
- Select a service principal, or select Add service principal.
- On its Secrets tab, select Generate secret.
- Set the lifetime in days, leave Scopes empty, then select Generate.
- Copy the secret and the client ID, then select Done.
Databricks shows the secret only once. On Azure, generate the secret in the Databricks workspace. Artie can’t use a Microsoft Entra ID secret from the Azure portal.
Give the service principal Can use on the SQL warehouse. Then grant it access to the catalog, schema and volume by its application ID, which is the same value as its client ID:
GRANT USE CATALOG ON CATALOG my_catalog TO `6f0c8a4e-2b1d-4c7a-9e3f-5d8b1a2c4e6f`;
GRANT USE SCHEMA, CREATE TABLE ON SCHEMA my_catalog.my_schema TO `6f0c8a4e-2b1d-4c7a-9e3f-5d8b1a2c4e6f`;
GRANT READ VOLUME, WRITE VOLUME ON VOLUME my_catalog.my_schema.my_volume TO `6f0c8a4e-2b1d-4c7a-9e3f-5d8b1a2c4e6f`;Replace 6f0c8a4e-2b1d-4c7a-9e3f-5d8b1a2c4e6f with your service principal’s application ID. If the schema already has tables Artie writes to, also grant SELECT and MODIFY on them.
For more detail, see Databricks’ OAuth for service principals.
4. Add Databricks in Artie
These steps create the destination in the pipeline setup flow.
- On the Choose destination step, select Databricks.
- On the Prepare destination step, select Continue.
- On the Connect and verify step, enter Host, HTTP path and Volume name.
- Under Authentication method, select Personal access token or OAuth M2M (service principal).
- Enter the Personal access token, or the Client ID and Client secret.
- In Unity catalog name, select the catalog Artie writes to.
- In Schema name, select the schema Artie writes to.
To create a catalog or schema from either field, type a new name and select the Create option.
If a schema is missing from the list, grant the user or service principal Artie connects as USE SCHEMA on it. Artie lists schemas through the Unity Catalog API, so it only sees the schemas it can use.
If your source has schemas, a Schema control appears with One schema and Multiple schemas. Multiple schemas writes each table to a schema named after its source schema. Every one of those schemas needs the volume.
If you choose an existing Databricks connector instead, Artie skips Prepare destination. The connector’s credentials stay as they are, and you set only the catalog and schema.
Verify the connection
On the Connect and verify step, select Verify destination. Artie shows “Destination verified” when the check passes. The check confirms that each schema Artie writes to exists and contains the volume.
The check needs tables. If a source with a Choose tables step has none chosen, the button reads Test connection. Artie then shows “Choose tables before verifying the destination.” Choose tables, then verify.
Advanced settings
Four optional settings change how Artie writes to Databricks. All four are off until you turn them on.
| Setting in pipeline setup | Label on the pipeline page | Terraform attribute | What it does |
|---|---|---|---|
| Automatic liquid clustering | Enable automatic liquid clustering | databricks_auto_liquid_clustering | Creates tables with automatic liquid clustering. |
| Turn off variant shredding | Turn off variant shredding | databricks_disable_variant_shredding | Creates tables with variant shredding turned off. |
| JSON as VARIANT | Store JSON as VARIANT | struct_as_variant | Stores new JSON, nested object and array columns as VARIANT. |
| Raw binary | Write raw binary values | write_raw_binary_values | Writes binary values as raw bytes in BINARY columns instead of Base64 strings. |
When you create a pipeline, expand Advanced options on the Connect and verify step. For an existing pipeline, select Edit pipeline, open the Destination: Databricks tab, then expand Advanced settings. The four checkboxes are under Data handling. Select Deploy to apply a change.
Automatic liquid clustering
Artie creates new tables with CLUSTER BY AUTO. Staging tables are left unclustered. The setting needs Unity Catalog managed tables with predictive optimization turned on.
After each deploy, Artie runs ALTER TABLE ... CLUSTER BY AUTO on the pipeline’s existing tables, including history mode tables. Tables that already use automatic clustering are skipped. Databricks then clusters the existing data in the background.
Artie emails the people who receive table change notifications with the list of tables it changed. Turning the setting off doesn’t remove clustering from existing tables.
Turn off variant shredding
On Databricks Runtime 17.3 and later, Databricks turns on variant shredding by default for new tables with VARIANT columns. Shredding speeds up reads of VARIANT data but adds overhead to every write. Turning it off speeds up writes and can slow down reads of VARIANT columns.
Turn shredding off for raw or bronze tables that are written often and read by only a few downstream jobs, to prioritize write throughput.
When you turn this setting on, Artie:
- Creates new tables, including its staging tables, with
delta.enableVariantShredding = false. - Sets
delta.enableVariantShredding = falseon the pipeline’s existing tables after each deploy. Tables that already have it turned off are skipped. - Emails the people who receive table change notifications with the list of tables it changed.
With Terraform, set databricks_disable_variant_shredding on your artie_pipeline resource:
resource "artie_pipeline" "bronze" {
# ...
databricks_disable_variant_shredding = true
}The setting only affects new writes. Data that Databricks already shredded stays shredded and can still be read normally.
To rewrite it in the unshredded format, run ALTER TABLE my_catalog.my_schema.my_table DROP FEATURE variantShredding; yourself. This rewrites the table’s shredded data, so the run time grows with the size of the table.
Turning the setting back off doesn’t turn shredding back on for tables Artie already changed.
JSON as VARIANT
Without this setting, Artie stores JSON and nested object columns as STRING and array columns as ARRAY<string>. With it, new columns of those kinds are VARIANT. It needs Databricks Runtime 15.4 LTS or later.
Primary keys and existing columns keep their type. Turning the setting off later doesn’t convert VARIANT columns back.
Dynamic tables
For high-throughput tables, Artie can append every change to a table instead of merging each batch. A Databricks streaming table then keeps the latest row per key. This is in early access. See Dynamic tables.
Was this page helpful?
- Need help? Message us on Slack or email [email protected].
- Want a walkthrough? Book a demo.
- LLM? Read llms.txt.