# Databricks

## Creating a connection

To connect a Databricks table to Telmai, you'll need to gather specific information from your Databricks instance. Follow the steps below:

### **Capture Connection Details.**

You can find the JDBC connectivity details in the Databricks workspace console:

Navigate to **Compute** -> **Cluster** -> **Cluster Name** -> **Configuration** -> **Advanced Options** -> **JDBC/ODBC**.

Capture the following details:

* **Server Hostname**
* **Port**
* **HTTP Path**

For more information, refer to the : [![](https://docs.databricks.com/en/_static/favicon.ico)Databricks ODBC and JDBC Drivers](https://docs.databricks.com/integrations/bi/jdbc-odbc-bi.html)

### **Generate a Security Token**

A security token is required to connect to the cluster remotely. Create this token from the Databricks workspace console:

* Go to the top right corner and click on your **User Name** -> **User Settings** -> **Access Token** -> **Generate New Token**.
* Capture the token created.

For detailed instructions, see the[![](https://docs.databricks.com/en/_static/favicon.ico)Authentication for Databricks tools and APIs](https://docs.databricks.com/dev-tools/api/latest/authentication.html#token-management)

### Create a connection in Telmai <a href="#source-in-telmai" id="source-in-telmai"></a>

Once you have the necessary information, navigate to the "Connections" page, click +New Connection, select databricks, and enter the following properties:

* **Host:** Cluster hostname
* **Port:** Cluster port
* **HTTP path:** HTTP path of the cluster
* **Token:** API token
* **Read from UnityCatalog:** A flag that enables spark job to read from UnityCatalog directly. This option will only work in case of using Databricks for Telmai-Spark jobs.

{% hint style="warning" %}
Only use "Read from UnityCatalog" if running Telmai jobs in Databricks and provide access to Telmai service account to the data being accessed. Otherwise, data scans will fail.
{% endhint %}

<figure><img src="https://604868671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkO3-a8YVu1iq1jP__S%2Fuploads%2FNAnxSdztLjmPIEPlxxRb%2Fimage.png?alt=media&#x26;token=5832b0e6-0b2c-4d6a-8f88-57402d3edeed" alt=""><figcaption></figcaption></figure>

## Connecting an asset

Once a connection is defined, you can start using it to create assets. To create assets, you will need:

* **Schema:** Schema name (i.e., database name)
* **Catalog (Optional):** Unity catalog name

Alternatively, you can run a SQL query

<figure><img src="https://604868671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkO3-a8YVu1iq1jP__S%2Fuploads%2FEGSCWDicj1vPlFraKAo9%2Fimage.png?alt=media&#x26;token=9af6d8be-72de-489a-ae61-683837c12c84" alt=""><figcaption></figcaption></figure>
