> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Databricks in Deepline

> Prefer semantic queries when a Databricks semantic layer is configured. Use direct SQL only for explicit read-only SQL requests; mutating SQL is unsupported.

[Human guide: work with your agent →](https://deepline.com/docs/human/providers/databricks/guide.md)
Inspect one Databricks action before starting provider-backed work. Your first result is a verified input and output contract.

## Provider-specific requirements

Use `databricks_get_semantic_layer` before choosing semantic table, metric, dimension, or filter names. Prefer `databricks_run_semantic_query` for governed analytics and `databricks_run_query` only when the user supplies SQL or explicitly needs SQL-level control.

When the customer already governs business measures in a Unity Catalog Metric View, use `databricks_import_metric_view` with its default preview mode. Review the generated YAML before using `save: true`. Metric View measures are mapped to Databricks `MEASURE(...)` expressions. parameterized Metric Views must be queried directly as table-valued functions.

Direct queries are read-only. Mutating SQL is unsupported because Statement Execution has no submission idempotency key. Use Databricks named parameter markers (`:customer_id`) with `parameters`. Never interpolate untrusted values into SQL.

Results are bounded and may be truncated. For large downstream datasets, use the Play dataset path, which performs count and page queries without loading the full result into agent context.

### Connect Databricks

In Databricks, open **SQL Warehouses**, select the warehouse Deepline should use, and open **Connection details**. Map the values into Deepline as follows:

![Databricks SQL warehouse Connection details showing Server hostname, Workspace ID, and HTTP path](https://mintcdn.com/deepline2/fNCWI1lSLCN_XuWj/images/integrations/databricks/warehouse-connection-details.png?fit=max\&auto=format\&n=fNCWI1lSLCN_XuWj\&q=85\&s=5055003717a7fb0f06ab417c4bf1ba02)

| Databricks value | Deepline field | What to enter |
| - | - | - |
| Server hostname | Workspace URL | Prefix the hostname with `https://`. Do not include a path. |
| HTTP path | SQL warehouse ID | Enter only the value after `/sql/1.0/warehouses/`. |
| Personal access token | Personal access or OAuth token | Paste the token once. Deepline stores it as a secret. |
| Catalog | Default catalog | Optional. Use the Unity Catalog catalog that contains the governed data. |
| Schema | Default schema | Optional. Use the schema Deepline should resolve unqualified table names against. |

Workspace ID, JDBC URL, and the displayed OAuth URL are not required for a token connection. For production automation, prefer a Databricks service principal with OAuth M2M credentials and least-privilege `CAN USE` access to the SQL warehouse plus the required Unity Catalog grants. Do not enter both a token and OAuth client credentials.

For PAT authentication, open **Settings → Developer → Access tokens** and select **Generate new token**. Copy the token when Databricks shows it. The value is displayed only during creation.

![Databricks Developer settings with the Generate new token action](https://mintcdn.com/deepline2/fNCWI1lSLCN_XuWj/images/integrations/databricks/personal-access-token-settings.png?fit=max\&auto=format\&n=fNCWI1lSLCN_XuWj\&q=85\&s=eaa5d8c45f9f6474aa94e9b19c0ae306)

After saving, use **Test** in the Deepline integration row. A successful test returns the Databricks user, current catalog, and current schema used for subsequent queries.

Databricks references:

* [SQL warehouse connection details](https://docs.databricks.com/aws/en/integrations/compute-details)
* [Create a personal access token](https://docs.databricks.com/aws/en/dev-tools/auth/pat)
* [Authorize a service principal with OAuth M2M](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m)

## Find an applicable action

Confirm your effective workspace, then search the live catalog:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline auth status --json
deepline search "Databricks" --type tools --json
```

Search returns candidates. Check the returned provider and operation rather than selecting a similar title automatically.

## Inspect the selected contract

Replace `<returned-tool-id>` with the identifier returned by discovery:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline describe <returned-tool-id> --json
```

These commands do not execute the selected provider action. Read its required inputs, supported access mode, pricing unit, outputs, and limits.

A connection does not establish that every action supports BYOK. Follow the provider-specific requirements above and the live action contract.

## Prepare one reviewed input

Use one authorized record that matches the inspected schema. Preserve its source identity and define the result you will accept.

Open the action reference for its payload and response shape. Provider-backed execution can incur usage or external effects.

For reusable logic, follow [Write Plays](https://deepline.com/docs/sdk-v2/plays.md). For direct-call recovery, use [Tool execution recovery](https://deepline.com/docs/sdk-v2/tool-execution-recovery.md).

> [!TIP]
>
> Continue only when the workspace, provider, required fields, acceptance rule, and applicable price are understood. Keep unavailable access separate from no-result evidence.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.