This article covers:

  1. How to set up a connection to a Databricks database
  2. How to add datasets
  3. How to do connection overrides on a Databricks connection
  4. The supported Databricks data types and the respective Luzmo data type they are mapped to

1. How to setup a Databricks connection

Navigate to the Connections page select 'New connection'. Select the 'Databricks' connector. You'll be asked to provide a Server Host Name, Http Path and Token.

  • User Access Token: Databricks access token. This can be created by a Databricks workspace owner by:
    • Clicking on your user on the top right
    • Selecting User Settings
    • Selecting Developer
    • Clicking on "Manage" next to Access tokens
    • And clicking on Generate new token
  • Http Path: HTTP Path as specified by Databricks in SQL Warehouses -> [select your SQL warehouse name] -> connection details, e.g. /sql/1.0/warehouses/xxxxxxxxxxx
  • Server Host Name: this is the Server hostname as specified by Databricks in SQL Warehouses -> [select your SQL warehouse name] -> connection details, e.g. abc-12345678-abcd.cloud.databricks.com

After connecting, you can now select, connect and visualize your Databricks data.

Please refer to the examples in our developer documentation to find out how to create a connection to Databricks via our API.

Notes: Make sure to whitelist Luzmo's range of IP addresses in your Databricks server if external connections are blocked as described here.

2. How to add datasets

Once you have connected your Databricks you can add datasets as explained here. You can select one or multiple datasets as available in your Databricks and link them in Luzmo to ensure they can be used together in a dashboard. Also make sure to check out this article on Preparing your data for analytics.

To find out how to add datasets using our API, please refer to this example in our developer documentation.

3. Databricks Connection Overrides

When generating an Authorization token to grant a user acces to your embedded dashboards it is possible to override the data source properties in the authorization request to dynamically use different properties. Find out more about connection overrides.

The fields available for overriding a Databricks connection are as follows:

  • Connection ID: The ID of the Connection to be overridden. Retrieve the ID to specify as detailed here.
  • serverhostname: The new Server Hostname.
  • httppath: The new http path
  • token: The new User Access Token
  • datasets: List of dataset-level overrides. Databricks uses a 3-namespace address system, Catalog.Schema.Table. When using account overrides, these parameters can be accessed per dataset as:
    • schema: The new catalog to query.
    • table: The new Databricks table to query. he table is a concatenation of the schema and table like this schema.table.

Our developer documentation has more info about connection overrides and an example of a Databricks connection overrides.

Example code demonstrating how to override the Databricks connection:

Override Connection Properties

Account connection properties can be accessed as:

{
 "account_overrides": {
   "< connection id >": {
	   "properties": {
	     "token": "Override User Access Token",
	     "httppath": "Override HTTP Path",
	     "serverhostname": "Override Server Host Name"
	   }
   }
 }
}

Override Table Address

Databricks uses a 3-namespace address system, Catalog.Schema.Table. When using account overrides, these parameters can be accessed per dataset as:

{
 "account_overrides": {
   "< connection id >": {
     "datasets": {
       "< dataset id >": {
         "schema": "< Override Databricks Catalog >",
         "table": "< Override Databricks Schema >.< Override Databricks Table >"
       }
     }
   }
 }
}

4. Supported Data Types

Data Type in Databricks Data Type in Luzmo
BIGINT numeric
BINARY numeric
DECIMAL(p,s) numeric
DOUBLE numeric
FLOAT numeric
INT numeric
SMALLINT numeric
TINYINT numeric
TIMESTAMP datetime
TIMESTAMP_NTZ datetime
DATE datetime
INTERVAL datetime
BOOLEAN hierarchy
VOID hierarchy
STRING hierarchy

Need more information?

Do you still have questions? Let us know how we can help.
Send us feedback!