This article covers:
Go to the Connections page and select New connection, then select the Databricks connector. Open Authentication and choose one of these methods.
Personal access token. You create this token yourself in Databricks.
OAuth2 machine-to-machine. Choose this when the connection should belong to a service principal rather than a person.
all-apis scope. Luzmo requests that scope when it fetches a token, so a secret limited to sql won't connect.Both modes also need the warehouse connection details. In Databricks, open SQL Warehouses, select the warehouse, and copy the values from the connection details.
abc-12345678-abcd.cloud.databricks.com/sql/1.0/warehouses/xxxxxxxxxxxSelect Connect. You can then select 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. Put the connection fields inside properties. For a personal access token, set serverHostname, httpPath, and token. For a service principal, set serverHostname, httpPath, authType to oauth-m2m, clientId, and clientSecret.
Notes: If your Databricks server blocks external connections, whitelist Luzmo's IP addresses as described in connect a database by whitelisting our IP addresses.
Once you have connected your Databricks, you can add datasets. 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.
When you create an embed token, you can override the Databricks connection properties for that session. Find out more about connection overrides.
Put overrides inside properties, using the same field names as the connection. Luzmo matches those names without regard to capitalization, so serverHostname and serverhostname refer to the same field. To find the connection ID, see retrieving a connection ID in our developer documentation.
For a personal access token connection, you can override serverHostname, httpPath, and token. For a service principal connection, you can override serverHostname, httpPath, authType, clientId, and clientSecret. Set authType to oauth-m2m when you send client credentials.
You can also override the table address per dataset. Databricks uses a three-part address: catalog, schema, and table. Set schema to the new catalog. Set table to the schema and table joined by a dot, such as schema.table.
Our developer documentation has more info about connection overrides and an example of a Databricks connection override.
{
"account_overrides": {
"< connection id >": {
"properties": {
"serverHostname": "Override Server Host Name",
"httpPath": "Override HTTP Path",
"token": "Override Token"
}
}
}
}
{
"account_overrides": {
"< connection id >": {
"properties": {
"serverHostname": "Override Server Host Name",
"httpPath": "Override HTTP Path",
"authType": "oauth-m2m",
"clientId": "Override Client ID",
"clientSecret": "Override Client Secret"
}
}
}
}
{
"account_overrides": {
"< connection id >": {
"datasets": {
"< dataset id >": {
"schema": "< Override Databricks Catalog >",
"table": "< Override Databricks Schema >.< Override Databricks Table >"
}
}
}
}
}
| 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 |