【发布时间】:2022-01-20 11:28:32
【问题描述】:
我正在尝试让 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 和 java jar 文件我已经安装在 databricks 上,但不是 C 库。我找到了要下载到笔记本电脑的 ubuntu 库,但 databricks 中的“上传库”功能似乎只需要 jar。
有人知道如何让 R 在 Databricks 中与 MariaDB 对话吗?或者,是否可以在笔记本的 python 单元中进行查询(我有这个工作)并访问 R 单元中的数据?
谢谢
【问题讨论】:
-
Databricks 支持用于 Python 包的 Conda。 Conda 在某种程度上支持 R,也许您需要的软件包可以通过 Conda 获得?
-
我不认为它本身就是包,Georg。我可以通过 databricks 或 RStudio 中的正常路径安装它。问题是它似乎有一个 mariadb 的 c 库的先决条件,我不知道如何安装它。我对其他 R 包没有问题,例如 sparkly、tidy verse 或 xts。
-
完全正确,应该包含在 Conda 中,所以它应该以这种方式工作
标签: r apache-spark azure-databricks mariadb-connector-c