Initializes the connector for table type of storage. See ConnectorDatabricksTable for details.
Arguments
- http_path
character The path to the Databricks cluster or SQL warehouse you want to connect to
- catalog
character The catalog to use
- schema
character The schema to use
- ...
Additional parameters sent to
DBI::dbConnect()for theodbc::databricks()driver, e.g.workspace,uid,pwdordriver.useNativeQuerydefaults toFALSE.- extra_class
character Extra class to assign to the new connector
Value
A new ConnectorDatabricksTable object
Details
The extra_class parameter allows you to create a subclass of the
ConnectorDatabricksTable object. This can be useful if you want to create
a custom connection object for easier dispatch of new s3 methods, while still
inheriting the methods from the ConnectorDatabricksTable object.
Examples
if (FALSE) { # \dontrun{
# Establish connection to your cluster
con_databricks <- connector_databricks_table(
http_path = "path-to-cluster",
catalog = "my_catalog",
schema = "my_schema"
)
# List tables in my_schema
con_databricks$list_content()
# Read and write tables
con_databricks$write(mtcars, "my_mtcars_table")
con_databricks$read("my_mtcars_table")
# Use dplyr::tbl
con_databricks$tbl("my_mtcars_table")
# Remove table
con_databricks$remove("my_mtcars_table")
# Disconnect
con_databricks$disconnect()
} # }
