Databricks Connector
There are three ways to use Databricks data: sample in place through a SQL warehouse, sample in place through a notebook’s own Spark session, or read a table into memory with read().
Installation
Sample in place through a SQL warehouse
warehouse() looks up the SQL warehouse by its id and authenticates as workspace — it reads no credential from the environment itself, so how workspace authenticates is the one place to look. The connection is yours; warehouse() does not close it. tables maps the names your query uses to the names in Databricks; leave it out to describe every table the source holds, which costs seconds per table on a large schema.
Sample in place through a notebook’s Spark session
In a Databricks notebook, pass the notebook’s own spark instead of a warehouse connection — no SQL warehouse needed:
This needs Databricks Runtime 17.3 LTS or serverless environment 4 or later, which have DataFrame.toArrow(). On an older runtime, name a SQL warehouse instead, as above.
Databricks metric views
A Databricks metric view already states its tables, joins, and columns. Convert it directly:
Its expressions run as SQL under your own credentials, so by default only pure, deterministic built-in functions are allowed; pass trust_expressions=True on semantic_model(...) to keep an expression that calls something else, when you trust whoever wrote the view. schema.conversion_notes lists what the conversion resolved.
Read into memory instead
Prefer short-lived credentials or your organization’s managed identity mechanism when the deployment supports it. Do not store access tokens in source files.
Authenticate from the environment
When connection arguments are omitted, read() falls back to these environment variables:
Every connection or API request structured-data-models-client opens on Databricks identifies itself as nvidia_structured-data-models-client/<version>, as Databricks requires of a partner product, and a warehouse session it opens tags its statements structured_data_models_client_purpose: sampling in query history. A connection you open yourself and pass to a source is used as it is.
Review the inferred schema and relationships before predicting — see Build a Schema. For a model served on Databricks Model Serving, see Connect from Databricks.