将R与MacOS上的ODBC驱动程序连接到Athena
我正在尝试使用ODBC从R访问Athena的数据。
我通过Brew和Web的Simba Athena ODBC驱动程序安装了UnixoDBC。
当我运行时:
con <- DBI::dbConnect(
odbc::odbc(),
Driver = "/Library/simba/athenaodbc/lib/libathenaodbc_sb64.dylib",
S3OutputLocation = "",
AwsRegion = Sys.getenv("AWS_DEFAULT_REGION"),
AuthenticationType = "IAM Credentials",
UID = Sys.getenv("AWS_ACCESS_KEY_ID"),
PWD = Sys.getenv("AWS_SECRET_ACCESS_KEY")
)
我有一个错误:
错误:nanodbc/nanodbc.cpp:1021:00000:[unixodbc] [驱动程序 经理]无法打开LIB '/library/simba/athenaodbc/lib/libathenaodbc_sb64.dylib':不档案 找到
了这个文件,肯定存在,为什么UnixoDBC找不到此文件?
我从网络上安装了R和Rstudio,而不是通过Homebrew,这是SessionInfo:
version R version 4.1.3 (2022-03-10)
os macOS Monterey 12.2
system aarch64, darwin20
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Paris
date 2022-04-08
rstudio 2022.02.0+443 Prairie Trillium (desktop)
pandoc NA
I'm trying to access data on Athena from R using ODBC.
I installed unixODBC via brew and the Simba Athena ODBC Driver from the web.
When I run :
con <- DBI::dbConnect(
odbc::odbc(),
Driver = "/Library/simba/athenaodbc/lib/libathenaodbc_sb64.dylib",
S3OutputLocation = "",
AwsRegion = Sys.getenv("AWS_DEFAULT_REGION"),
AuthenticationType = "IAM Credentials",
UID = Sys.getenv("AWS_ACCESS_KEY_ID"),
PWD = Sys.getenv("AWS_SECRET_ACCESS_KEY")
)
I have this error :
Error: nanodbc/nanodbc.cpp:1021: 00000: [unixODBC][Driver
Manager]Can't open lib
'/Library/simba/athenaodbc/lib/libathenaodbc_sb64.dylib' : file not
found
But this file exists for sure, why unixODBC can't find this file ?
I installed R and RStudio from the web and not via Homebrew, here is the sessionInfo :
version R version 4.1.3 (2022-03-10)
os macOS Monterey 12.2
system aarch64, darwin20
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Paris
date 2022-04-08
rstudio 2022.02.0+443 Prairie Trillium (desktop)
pandoc NA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能在这里偏离了基础,但我总是在实例化调用中使用
Driver=
作为驱动程序的名称,而不是它的库的位置。我确信这是一个 ODBC 问题,所以无论您使用的是 macos 还是 Linux,或者连接到 SQL Server、MariaDB 或其他系统,都没有关系。例如,在 linux-box 上,在
/etc/odbcinst.ini
中,我有以下部分:当我连接到 SQL Server 实例时,我的调用是
该文件不需要定义在
/etc/
下,还有其他方法来声明这些驱动程序段。I might be off-base here, but I've always used
Driver=
in the instantiation call to be the name of a driver, not the location of a library for it. I am confident this is an ODBC thing, so doesn't matter if you're on macos or linux, or connection to SQL Server or MariaDB or another.On a linux-box, for instance, in
/etc/odbcinst.ini
, I have the following section:When I connect to a SQL Server instance, my call is
The file does not need to be defined under
/etc/
, there are other ways to declare those driver segments.