---
title: Connect to Looker
description: Learn how to connect your Databricks workspace to Looker, a platform for business intelligence, data applications, and embedded analytics.
canonical_url: https://docs.databricks.com/aws/en/partners/bi/looker
---

# Connect to Looker

This article describes how to use Looker with a Databricks cluster or Databricks SQL warehouse (formerly Databricks SQL endpoint).

> [!IMPORTANT]
>
> When persistent derived tables (PDTs) are enabled, by default Looker regenerates PDTs every 5 minutes by connecting to the associated database. Databricks recommends that you change the default frequency to avoid incurring excess compute costs. For more information, see [Enable and manage persistent derived tables (PDTs)](https://docs.databricks.com/aws/en/partners/bi/looker.md#persistent-derived-tables).

## <a id="manual-requirements" />Requirements

Before you connect to Looker manually, you need the following:

* A cluster or SQL warehouse in your Databricks workspace.
  * [Compute configuration reference](https://docs.databricks.com/aws/en/compute/configure.md).
  * [Create a SQL warehouse](https://docs.databricks.com/aws/en/compute/sql-warehouse/create.md).
* The connection details for your cluster or SQL warehouse, specifically the **Server Hostname**, **Port**, and **HTTP Path** values.
  * [Get connection details for a Databricks compute resource](https://docs.databricks.com/aws/en/integrations/compute-details.md).
* A Databricks [personal access token](https://docs.databricks.com/aws/en/dev-tools/auth/pat.md). To create a personal access token, follow the steps in [Create personal access tokens for workspace users](https://docs.databricks.com/aws/en/dev-tools/auth/pat.md#pat-user).

  > [!NOTE]
  >
  > As a security best practice when you authenticate with automated tools, systems, scripts, and apps, Databricks recommends that you use [OAuth tokens](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m.md).
  >
  > If you use personal access token authentication, Databricks recommends using personal access tokens belonging to [service principals](https://docs.databricks.com/aws/en/admin/users-groups/service-principals.md) instead of workspace users. To create tokens for service principals, see [Manage tokens for a service principal](https://docs.databricks.com/aws/en/admin/users-groups/manage-service-principals.md#tokens).

## <a id="manual-connection" />Connect to Looker manually

To connect to Looker manually, do the following:

1. In Looker, click **Admin > Connections > Add Connection**.

   ![Connection parameters](https://docs.databricks.com/aws/en/images/third-party-integrations/looker/looker-databricks-connect.png)

2. Enter a unique **Name** for the connection.

   > [!TIP]
   >
   > Connection names should contain only lowercase letters, numbers, and underscores. Other characters might be accepted but could cause unexpected results later.

3. For **Dialect**, select **Databricks**.

4. For **Remote Host**, enter the **Server Hostname** from the requirements.

5. For **Port**, enter the **Port** from the requirements.

6. For **Database**, enter the name of the database in the workspace that you want to access through the connection (for example, `default`).

7. For **Username**, enter the word `token`.

8. For **Password**, enter your personal access token from the requirements.

9. For **Additional Params**, enter `transportMode=http;ssl=1;httpPath=<http-path>`, replacing `<http-path>` with the **HTTP Path** value from the requirements.

   If Unity Catalog is enabled for your workspace, additionally set a default catalog. Enter `ConnCatalog=<catalog-name>`, replacing `<catalog-name>` with the name of a catalog.

10. For **PDT And Datagroup Maintenance Schedule**, enter a valid `cron` expression to change the default frequency for regenerating PDTs. The default frequency is every five minutes.

11. If you want to translate queries into other time zones, adjust **Query Time Zone**.

12. For the remaining fields, keep the defaults, in particular:
    * Keep the **Max Connections** and **Connection Pool Timeout** defaults.
    * Leave **Database Time Zone** blank (assuming that you are storing everything in UTC).

13. Click **Test These Settings**.

14. If the test succeeds, click **Add Connection**.

## Model your database in Looker

This section creates a project and runs the generator. The following steps assume that there are permanent tables stored in the database for your connection.

1. On the **Develop** menu, turn on **Development Mode**.

2. Click **Develop > Manage LookML Projects**.

3. Click **New LookML Project**.

4. Enter a unique **Project Name**.

   > [!TIP]
   >
   > Project names should contain only lowercase letters, numbers, and underscores. Other characters might be accepted but could produce unexpected results later.

5. For **Connection**, select the name of the connection from Step 2.

6. For **Schemas**, enter `default`, unless you have other databases to model through the connection.

7. For the remaining fields, keep the defaults, in particular:
   * Leave **Starting Point** set to **Generate Model from Database Schema**.
   * Leave **Build Views From** set to **All Tables**.

8. Click **Create Project**.

After you create the project and the generator runs, Looker displays a user interface with one `.model` file and multiple `.view` files. The `.model` file shows the tables in the schema and any discovered join relations between them, and the `.view` files list each dimension (column) available for each table in the schema.

## <a id="persistent-derived-tables" />Enable and manage persistent derived tables (PDTs)

Looker can reduce query times and database loads by creating *persistent derived tables* (PDTs). A PDT is a derived table that Looker writes into a scratch schema in your database. Looker then regenerates the PDT on the schedule that you specify. For more information, see [Persistent derived tables (PDTs)](https://docs.looker.com/data-modeling/learning-lookml/derived-tables#persistent_derived_table) in the Looker documentation.

To enable PDTs for a database connection, select **Persistent Derived Tables** for that connection and complete the on-screen instructions. For more information, see [Persistent Derived Tables](https://docs.looker.com/setup-and-management/connecting-to-db#persistent_derived_tables) and [Configuring Separate Login Credentials for PDT Processes](https://docs.looker.com/setup-and-management/connecting-to-db#pdt-overrides) in the Looker documentation.

When PDTs are enabled, by default Looker regenerates PDTs every 5 minutes by connecting to the associated database. Looker restarts the associated Databricks resource if it is stopped. Databricks recommends that you change the default frequency by setting the **PDT And Datagroup Maintenance Schedule** field for your database connection to a valid `cron` expression. For more information, see [PDT and Datagroup Maintenance Schedule](https://docs.looker.com/setup-and-management/connecting-to-db#pdt_maintenance_schedule) in the Looker documentation.

To enable PDTs or to change the PDT regeneration frequency for an existing database connection, click **Admin > Database Connections**, click **Edit** next to your database connection, and follow the preceding instructions.

## <a id="additional-resources" />Additional resources

To begin working with your project, see the following resources on the Looker website:

* [Exploring data in Looker](https://docs.looker.com/exploring-data/exploring-data)

* [Creating Visualizations and Graphs](https://docs.looker.com/exploring-data/visualizing-query-results)

* [Retrieve and chart data](https://docs.looker.com/exploring-data/retrieve-chart-intro)

* [Looker documentation](https://docs.cloud.google.com/looker/docs/intro)
