# Databricks

> **This guide is for Databricks.** See also: [Snowflake](/development/engineering/docs/rox-enterprise-integrations/data-warehouse-integration/snowflake.md) | [BigQuery](/development/engineering/docs/rox-enterprise-integrations/data-warehouse-integration/bigquery.md)

### Introduction

The **ROX Databricks Integration** enables customers to share live data directly from Databricks to ROX using **Delta Sharing**. Delta Sharing is an open protocol for secure data sharing that works across clouds and platforms—you retain full control while ROX gains real-time access to your datasets.

***

### Key Benefits

| Benefit                    | Description                                                         |
| -------------------------- | ------------------------------------------------------------------- |
| **Full Control**           | Data stays in your workspace. You can revoke access at any time.    |
| **Zero-Copy Architecture** | No data duplication—ROX queries your live Delta tables directly.    |
| **Real-Time Access**       | ROX always sees the latest data without ETL or batch jobs.          |
| **Open Protocol**          | Delta Sharing is an open standard, avoiding vendor lock-in.         |
| **Secure by Default**      | All access governed by Unity Catalog and Delta Sharing permissions. |

***

### ROX Account Information

> **Contact your ROX account team** to obtain the ROX Metastore ID and Share name required for setting up Delta Sharing.

Your ROX account team will provide:

* **Share name** — The name to use when creating the share
* **ROX Metastore ID** — Required when creating the recipient

***

### Setup Instructions

#### Step 1: Enable External Delta Sharing

1. In your Databricks workspace, navigate to **Catalog → Delta Sharing → Share Data**
2. If you see a warning that external sharing is not enabled, click **Enable External Delta Sharing**

<figure><img src="/files/juVgapDr0w4kbxgj9vV7" alt=""><figcaption></figcaption></figure>

3. Additionally, go to **Account → Previews** and enable **Delta Sharing for Default Storage – Expanded Access**

***

#### Step 2: Create the Share and Add ROX as Recipient

You can set up Delta Sharing via the **UI** or **SQL**.

| Method  | Best For                                                    |
| ------- | ----------------------------------------------------------- |
| **UI**  | First-time setup, visual learners, quick single-share setup |
| **SQL** | Automation, scripting, bulk operations, version control     |

***

**Option 1: Using the UI**

**Create a Share:**

1. Navigate to **Catalog → Delta Sharing → Share Data**
2. Click **Create Share**
3. Enter the share name provided by your ROX account team
4. Click **Create**

**Add Data to the Share:**

1. Click into your newly created share
2. Click **Manage assets → Edit assets**
3. Select the schemas and/or tables you want to share with ROX
4. Click **Save**

**Add ROX as a Recipient:**

1. Navigate to **Catalog → Delta Sharing → Shared by me → Recipients**
2. Click **New recipient**
3. Enter `rox` as the recipient name
4. Select **Databricks-to-Databricks sharing**
5. Enter the ROX Metastore ID provided by your ROX account team
6. Click **Create**

**Grant Access to ROX:**

1. Go back to your share (**Catalog → Delta Sharing → Shared by me → Shares**)
2. Click into your share
3. Click **Manage recipients → Add recipients**
4. Select the `rox` recipient
5. Click **Add**

***

**Option 2: Using SQL**

Open a **SQL Editor** in the Databricks workspace where your data lives and run the following commands:

```sql
-- 1. Create the share (share name will be provided by ROX)
CREATE SHARE IF NOT EXISTS <share_name_from_rox>;

-- 2. Add your schema(s) to the share
ALTER SHARE <share_name_from_rox> ADD SCHEMA <your_schema_name>;

-- 3. Create ROX as a recipient (Metastore ID will be provided by ROX)
CREATE RECIPIENT IF NOT EXISTS rox USING ID '<rox_metastore_id>';

-- 4. Grant ROX access to the share
GRANT SELECT ON SHARE <share_name_from_rox> TO RECIPIENT rox;
```

> **Tip:** You can add multiple schemas by running additional `ALTER SHARE ... ADD SCHEMA` commands.

**Complete SQL Example:**

```sql
-- Replace placeholders with actual values from your ROX account team

-- 1. Create the share
CREATE SHARE IF NOT EXISTS ROX_CUSTOMER_SHARE;

-- 2. Add your schema(s)
ALTER SHARE ROX_CUSTOMER_SHARE ADD SCHEMA salesforce_data;
ALTER SHARE ROX_CUSTOMER_SHARE ADD SCHEMA crm_analytics;

-- 3. Create ROX as recipient
CREATE RECIPIENT IF NOT EXISTS rox USING ID 'abc123-your-rox-metastore-id';

-- 4. Grant access
GRANT SELECT ON SHARE ROX_CUSTOMER_SHARE TO RECIPIENT rox;
```

***

#### Step 3: Notify ROX

Once the share is configured, send the following to your ROX account team:

* Your Databricks workspace URL
* Share name
* Schema(s) and tables included in the share
* Brief description of shared data and its structure

***

### Choosing What to Share

| Object Type | When to Use                                                                 |
| ----------- | --------------------------------------------------------------------------- |
| **Tables**  | Direct access to raw data. Use when ROX needs full table access.            |
| **Views**   | Pre-filtered or aggregated data. Use to limit columns or apply row filters. |
| **Schemas** | Share an entire schema when ROX needs access to multiple related tables.    |

> **Best Practice:** Share at the schema level when possible for simpler management. Use views to restrict access to sensitive columns or rows.

***

### Information to Provide to ROX

After setting up the share, send the following to your ROX account team:

* Your Databricks workspace URL
* Share name
* Schema(s) and tables included in the share
* Brief description of shared data and its structure

***

### Prerequisites

| Requirement          | Details                                                                                             |
| -------------------- | --------------------------------------------------------------------------------------------------- |
| **Unity Catalog**    | Unity Catalog must be enabled on your workspace                                                     |
| **Permissions**      | `CREATE SHARE`, `CREATE RECIPIENT` privileges (typically requires metastore admin or catalog owner) |
| **External Sharing** | External Delta Sharing must be enabled (see Step 1)                                                 |
| **Expanded Access**  | Delta Sharing for Default Storage – Expanded Access must be enabled in Account Previews             |

***

### Technical Considerations

#### Security and Compliance

* All data sharing respects your existing Unity Catalog permissions
* ROX can only access schemas/tables explicitly added to the share
* Audit logs available in Unity Catalog for all access events

#### Performance

* Delta Sharing provides direct access to your Delta tables
* ROX queries run on ROX's compute resources, not yours
* No impact on your workspace's cluster performance

#### Data Freshness

* **Real-time** — ROX always queries your live Delta tables directly
* No replication delay or sync schedules

***

### Troubleshooting

| Issue                          | Solution                                                                    |
| ------------------------------ | --------------------------------------------------------------------------- |
| Cannot create share            | Verify Unity Catalog is enabled and you have `CREATE SHARE` privileges      |
| External sharing not available | Enable External Delta Sharing in Catalog → Delta Sharing settings           |
| Recipient creation fails       | Confirm you have the correct ROX Metastore ID from your ROX account team    |
| ROX cannot access shared data  | Verify the recipient was added to the share and granted access              |
| Tables not appearing in share  | Ensure the schema was added to the share via Manage assets or `ALTER SHARE` |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rox.com/development/engineering/docs/rox-enterprise-integrations/data-warehouse-integration/databricks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
