Expand 'connector' Package for 'Databricks' Tables and Volumes

Expands the 'connector' < https://github.com/NovoNordisk-OpenSource/connector> package and provides a convenient interface for accessing and interacting with 'Databricks' < https://www.databricks.com> volumes and tables directly from R.


connector.databricks connector.databricks website

Checks Codecov testcoverage Lifecycle:experimental

The connector.databricks package provides a convenient interface for accessing and interacting with Databricks volumes and tables directly from R.

This package is meant to be used with connector package, which provides a common interface for interacting with various data sources. The connector.databricks package extends the connector package to support Databricks tables and volumes through three connectors:

  • connector_databricks_sql(): tables, using a SQL warehouse through the brickster DatabricksSQL() driver. This is the preferred way of working with tables.
  • connector_databricks_table(): tables, using a cluster through the odbc::databricks() driver.
  • connector_databricks_volume(): files in Unity Catalog volumes, using brickster.

Installation

You can install the connector.databricks from CRAN package using the following command:

# Install from CRAN
install.packages("connector.databricks")

Development version

To get a bug fix or to use a feature from the development version, you can install the development version of connector.databricks from GitHub.

pak::pak("novonordisk-opensource/connector.databricks")

Usage

library(connector.databricks)

tables <- connector_databricks_sql(
  warehouse_id = "your-warehouse-id",
  catalog = "my_catalog",
  schema = "my_schema"
)

volume <- connector_databricks_volume(
  catalog = "my_catalog",
  schema = "my_schema",
  path = "path-to-file-storage"
)

tables |>
  write_cnt(mtcars, "mtcars")

tables |>
  read_cnt("mtcars")

volume |>
  write_cnt(iris, "iris.csv")

Credentials are read from the environment by the brickster package, for example DATABRICKS_HOST and DATABRICKS_TOKEN. See Authentication for how to set this up locally, on Posit Workbench and on Posit Connect.

To work with tables through a cluster with the odbc::databricks() driver, use connector_databricks_table(). See Choosing between ConnectorDatabricksSQL and ConnectorDatabricksTable for how the two table connectors differ.

The connectors can also be created from a configuration file with connector::connect(). See the getting started vignette for an example.

Contributing

We welcome contributions to the connector.databricks package. If you have any suggestions or find any issues, please open an issue or submit a pull request on GitHub.

License

This package is licensed under the Apache License.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("connector.databricks")

0.2.0 by Vladimir Obucina, 3 days ago


https://novonordisk-opensource.github.io/connector.databricks/, https://github.com/NovoNordisk-OpenSource/connector.databricks


Report a bug at https://github.com/NovoNordisk-OpenSource/connector.databricks/issues


Browse source code at https://github.com/cran/connector.databricks


Authors: Vladimir Obucina [aut, cre] , Steffen Falgreen Larsen [aut] , Aksel Thomsen [aut] , Cervan Girard [aut] , Oliver Lundsgaard [ctb] , Skander Mulder [ctb] , Novo Nordisk A/S [cph]


Documentation:   PDF Manual  


Apache License (>= 2) license


Imports arrow, brickster, checkmate, cli, connector, DBI, dbplyr, dplyr, fs, hms, lifecycle, odbc, purrr, R6, rlang, withr, zephyr

Suggests glue, knitr, mockery, rmarkdown, testthat, tibble, whirl


See at CRAN