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 with YEAR(x), DAYOFYEAR(x), DAYOFWEEK(x), WEEKOFYEAR(x).
  • CTEs for the per-fact subqueries and a FULL OUTER JOIN when 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_list and try_divide are fine in expression.sql.
  • Unity Catalog names go in physical_name as catalog.schema.table, or schema.table when your application’s session sets a default catalog.

Next Steps