Databricks Adapter
Generate Databricks SQL from your model.
What the adapter emits
- Identifiers in
`backticks`; bare column names in expressions are lowercased. - Grain truncation as
DATE_TRUNC('month', x); parts withYEAR(x),DAYOFYEAR(x),DAYOFWEEK(x),WEEKOFYEAR(x). - CTEs for the per-fact subqueries and a
FULL OUTER JOINwhen a query blends measures from two facts.
Configuration
databricks_lakehouse:
adapter: databricks
name: Databricks Lakehouse
tier: warm
host: workspace-id.cloud.databricks.com
warehouse: 1234abcd5678ef90
catalog: main
schema: default
# oauth_client_id / oauth_client_secret: never here; your application holds them
Connection fields
0sql never connects to Databricks. Host, SQL warehouse id, catalog and schema are carried as metadata for your own application, which runs the SQL it gets back with its own service principal. 0sql never uses them. If secrets do land in datasources.yml, zsql deploy strips oauth_client_id, oauth_client_secret, personal_access_token and password before building the archive.
Notes
- Expressions are Databricks SQL.
approx_count_distinct,percentile_approx,collect_listandtry_divideare fine inexpression.sql. - Unity Catalog names go in
physical_nameascatalog.schema.table, orschema.tablewhen your application’s session sets a default catalog.