Skip to content

odbc::databricks() fails to auto-detect driver on Windows when registered as "Databricks ODBC Driver" #1030

Description

@vinhtantran

odbc::databricks()'s auto-detection logic (databricks_default_driver() in R/driver-databricks.R) hardcodes the Windows fallback driver name as "Databricks":

find_default_driver(
  databricks_default_driver_paths(),
  fallbacks = c("Databricks", "Simba Spark ODBC Driver"),
  label = "Databricks/Spark",
  call = quote(DBI::dbConnect())
)

A source comment states:

On Windows we use the official driver name.

However, the current official Databricks ODBC driver installer for Windows (version 2.12.1) registers the driver under the name "Databricks ODBC Driver", not "Databricks". This is visible both via odbc::odbcListDrivers() and directly in the Windows registry:

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers
    "Databricks ODBC Driver" = "Installed"

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Databricks ODBC Driver
    Description = "Databricks ODBC Driver"
    Driver      = "C:\Program Files\Databricks ODBC Driver\lib\DatabricksODBC64.dll"

Since neither "Databricks" nor "Simba Spark ODBC Driver" matches this registered name, auto-detection fails even though the driver is correctly installed:

odbc::odbcListDrivers()
#>                     name    attribute                  value
#> ...
#> 22   Databricks ODBC Driver Description Databricks ODBC Driver
DBI::dbConnect(
  odbc::databricks(),
  workspace = "https://<workspace>.azuredatabricks.net",
  httpPath  = "/sql/protocolv1/o/.../..."
)
#> Error in `DBI::dbConnect()`:
#> ! Failed to automatically find the Databricks/Spark ODBC driver.
#> ℹ Set `driver` to known driver name or path.

Passing driver = "Databricks ODBC Driver" explicitly works fine:

DBI::dbConnect(
  odbc::databricks(),
  driver    = "Databricks ODBC Driver",
  workspace = "https://<workspace>.azuredatabricks.net",
  httpPath  = "/sql/protocolv1/o/.../..."
)
#> works

Suggested fix: add "Databricks ODBC Driver" to the fallbacks vector in databricks_default_driver():

fallbacks = c("Databricks", "Databricks ODBC Driver", "Simba Spark ODBC Driver")

Environment:

R version 4.6.1 (2026-06-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26200)

odbc 1.7.0
DBI 1.3.0

Databricks ODBC Driver 2.12.1, installed via the official Databricks Windows installer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions