簡體   English   中英

Databricks 上的 RMariaDB

[英]RMariaDB on Databricks

我正在嘗試讓 R(通過筆記本或 RStudio)連接到 Databricks Azure 10.1 上的 MariaDB。 但是,無論我在集群的庫選項卡中添加 RMariaDB 還是通過 RStudio 中的 install.packages("RMariaDB") 都會失敗,因為:

-----------------------------[ ANTICONF ]-----------------------------
Configure could not find suitable mysql/mariadb client library. Try installing:
* deb: libmariadb-dev (Debian, Ubuntu)
* rpm: mariadb-connector-c-devel | mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
* csw: mysql56_dev (Solaris)
* brew: mariadb-connector-c (OSX)
If you already have a mysql client library installed, verify that either
mariadb_config or mysql_config is on your PATH. If these are unavailable
you can also set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------[ ERROR MESSAGE ]----------------------------
<stdin>:1:10: fatal error: mysql.h: No such file or directory
compilation terminated.
-----------------------------------------------------------------------

python, R, and java jar files I have installed on databricks, but not C libraries. 我發現 ubuntu 庫要下載到我的筆記本電腦,但數據塊中的“上傳庫”function 似乎只需要 jars。

任何人都知道如何讓 R 在 Databricks 中與 MariaDB 交談? 或者,是否可以在筆記本的 python 單元格中進行查詢(我有這個工作)並訪問 R 單元格中的數據?

謝謝

在 Spark/Databricks 上執行此操作的最簡單方法是使用spark.read.jdbc (請參閱文檔) - 您只需提供 JDBC ZE6B391A8D2C4D45902A23A8B6585703D、用戶名和密碼。

sparkR.session()
jdbcUrl <- "jdbc:mysql://<host>:3306/databasename"
df <- read.jdbc(jdbcUrl, "table", user = "username", password = "password")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM