Databricks Driver Documentation
This documentation explains the Databricks driver implementation and how connection parameters map to UI fields in the Gigantic application. The driver connects to a Databricks SQL Warehouse (or an all-purpose cluster) and works with the tables of one catalog and schema.
Databricks is listed under Cloud datasources in the driver selector and requires a Cloud license tier.
Connection Parameters
| UI Field | Technical Implementation | Description | Required | Default Value |
|---|---|---|---|---|
| Host | host in the @databricks/sql connection | Workspace hostname, without https:// (for example adb-1234567890.1.azuredatabricks.net) | Yes | None (must be specified) |
| HTTP Path | httpPath (sent as db) | HTTP path of the SQL Warehouse or cluster (for example /sql/1.0/warehouses/abc123) | Yes | None (must be specified) |
| Catalog | catalog (sent as schema) | Unity Catalog catalog that contains the tables | No | main |
| Schema | owner | Schema (database) inside the catalog | No | default |
| Password | token (sent as password) | Databricks personal access token | Yes | None (must be specified) |
Notes:
- The form has no Port field. The driver connects over HTTPS to the host on port 443, or on the local port of the SSH tunnel when the tunnel is enabled.
- The User field of the "User / Password" authentication is ignored. Only the Password field is used, and it must contain the access token.
- Tables are always addressed as
<catalog>.<schema>.<table>.
If any of the required values is missing the connection fails with one of these errors:
Databricks host is required
Databricks HTTP path is required
Databricks access token is requiredTechnical Details
The Databricks driver uses the official @databricks/sql Node.js library (DBSQLClient).
Connection process:
- Opens a client with host, HTTP path and token
- Opens a session with the catalog and schema as initial catalog and schema
- Runs
SELECT 1to check the connection
Schema discovery:
- Lists the tables of the schema from
<catalog>.INFORMATION_SCHEMA.TABLES(table typesTABLE,MANAGED,EXTERNALandVIEW) - Reads the columns from
INFORMATION_SCHEMA.COLUMNS - Gets the row count with
count(*)and the size fromDESCRIBE DETAIL(sizeInBytes) - Reads primary keys from
TABLE_CONSTRAINTSandCONSTRAINT_COLUMN_USAGE. This only works with Unity Catalog; without it the tables have no primary keys - Stores the table DDL from
SHOW CREATE TABLE - Inspects up to 4 tables at the same time
Type mapping:
| Databricks Type | Gigantic Type |
|---|---|
date, timestamp, timestamp_ntz | date |
tinyint, smallint, short, int, integer, long, bigint | number |
float, double, decimal, numeric | float |
binary, varbinary | buffer |
array, map, struct, json | object |
boolean and any other type | string |
Reading process:
- Builds a
SELECTwith the rule where, limit and offset - Fetches rows in batches of the read batch size of the job or rule (when none is set, the driver
batchSize, 10000) and streams them
Writing process:
- Inserts use multi-row
INSERT ... VALUESstatements in batches of the write batch size of the job or rule (when none is set, the driverbatchSize, 10000) - Only the columns that exist in the target table are written
- Strings are converted to numbers for numeric columns; values that cannot be converted are written as
NULL - Update and merge use
MERGE INTOon the primary key columns. They fail if the table has no primary key - When Retry On Fail is enabled, failed batches are split in half and retried (see Drivers Overview)
Write modes:
| Write mode | Behaviour |
|---|---|
| Drop | DROP TABLE IF EXISTS and creates the table again from the source DDL (without TBLPROPERTIES) |
| Truncate | TRUNCATE TABLE before loading |
| Append | Inserts rows into the existing table |
| Update / Merge | Keeps the table and runs MERGE INTO by primary key |
When the target table does not exist, it is created from the source DDL.
Authentication Options
| Auth Type | UI Mapping | Description |
|---|---|---|
| None | No credentials | Only works if the token is given in Custom Params (token) |
| User / Password | Password field | The Password field holds the personal access token. The User field is ignored |
| Password Manager | Password manager fields | The token is read from the password manager as the password |
SSH Tunnel Support
Enable Enable SSH? to reach the workspace through an SSH server. The driver then connects over HTTPS to the local port of the tunnel, which forwards the connection to the host on port 443.
API Endpoints Used
Databricks connections are used in:
- Tap creation (data source discovery)
- Sink creation (data destination for anonymized data)
- Pipeline execution (data extraction and loading)
Node.js Driver Dependency
- Library: @databricks/sql
- Purpose: Databricks SQL Warehouse and cluster connectivity
Custom Params
Custom Params (YAML) are merged into the driver configuration, so they can set or override these keys:
httpPath: /sql/1.0/warehouses/abc123 # Overrides the HTTP Path field
token: dapi0123456789abcdef # Access token, overrides the Password field
catalog: main # Overrides the Catalog field
batchSize: 5000 # Read/write batch size when the job or rule sets none (10000)Example Configurations
Unity Catalog table in a custom schema
catalog: salesWith the Schema field set to crm, tables are read as sales.crm.<table>.