Skip to main content

Configuration

FieldRequiredDescription
endpointYesUnity Catalog endpoint URL
secret_nameYesReference to project secret containing access token

Setup Steps

1. Get Your Endpoint URL

Copy your Databricks workspace URL:
https://workspace.cloud.databricks.com

2. Create an Access Token

  1. Go to your Databricks workspace
  2. Navigate to User Settings > Access Tokens
  3. Click Generate New Token
  4. Copy the token value

3. Store the Token

Create a project secret with your access token as the value.

4. Configure the Catalog

  1. Navigate to Catalogs in your project
  2. Click Create catalog
  3. Select Unity Catalog
  4. Enter your endpoint URL
  5. Select your token secret
  6. Click Create

Token Types

TypeUse Case
Personal access tokenDevelopment and testing
Service principal tokenProduction workloads (recommended)
For production, use service principal tokens for better security and auditability.

Example

import daft

def query_unity(catalog: daft.Catalog):
    """Query data from Unity Catalog."""
    # Load a table from Unity Catalog
    sales = catalog.load_table("main.sales.transactions")

    # Process the data
    summary = sales.groupby("region").agg(
        daft.col("amount").sum()
    )

    return summary.to_pydict()

Available Operations

Once connected, you can:
  • Load tables: catalog.load_table("catalog.schema.table")
  • Browse catalogs: Access tables across your Unity Catalog namespace
  • Query data: Use Daft DataFrame operations on loaded tables

Table Naming

Unity Catalog uses three-level namespacing:
catalog_name.schema_name.table_name
Example: main.sales.transactions