View source: R/driver-databricks.R
databricks | R Documentation |
Connect to Databricks clusters and SQL warehouses via the Databricks ODBC driver.
In particular, the custom dbConnect()
method for the Databricks ODBC driver
implements a subset of the Databricks client unified authentication
model, with support for personal access tokens, OAuth machine-to-machine
credentials, and OAuth user-to-machine credentials supplied via Posit
Workbench or the Databricks CLI on desktop.
All of these credentials are detected automatically if present using
standard environment variables.
databricks()
## S4 method for signature 'DatabricksOdbcDriver'
dbConnect(
drv,
httpPath,
workspace = Sys.getenv("DATABRICKS_HOST"),
useNativeQuery = TRUE,
driver = NULL,
HTTPPath,
uid = NULL,
pwd = NULL,
...
)
drv |
an object that inherits from DBIDriver, or an existing DBIConnection object (in order to clone an existing connection). |
httpPath , HTTPPath |
To query a cluster, use the HTTP Path value found
under |
workspace |
The URL of a Databricks workspace, e.g.
|
useNativeQuery |
Suppress the driver's conversion from ANSI SQL 92 to
HiveSQL? The default ( |
driver |
The name of the Databricks ODBC driver, or |
uid , pwd |
Manually specify a username and password for authentication. Specifying these options will disable automated credential discovery. |
... |
Further arguments passed on to |
An OdbcConnection
object with an active connection to a Databricks
cluster or SQL warehouse.
## Not run:
DBI::dbConnect(
odbc::databricks(),
httpPath = "sql/protocolv1/o/4425955464597947/1026-023828-vn51jugj"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.