我尝试使用DBI::dbConnect从RStudio连接到雅典娜,但我在打开驱动程序时遇到了问题。
con <- DBI::dbConnect(
odbc::odbc(),
Driver = "[Simba Athena ODBC Driver]",
S3OutputLocation = "[s3://bucket-folder/]",
AwsRegion = "[region]",
AuthenticationType = "IAM Credentials",
Schema = "[schema]",
UID = rstudioapi::askForPassword("AWS Access Key"),
PWD = rstudioapi::askForPassword("AWS Secret Key"))
Error: nanodbc/nanodbc.cpp:983: 00000: [unixODBC][Driver Manager]Can't open lib '[Simba Athena ODBC Driver]' : file not found此外,此代码不返回任何内容。
sort((unique(odbcListDrivers()[[1]])))
character(0)我的ODBC驱动程序似乎无法访问或安装不正确,但我无法理解原因。我已经下载了驱动程序,可以在我的库中看到它。
任何见解都是非常感谢的!
发布于 2020-09-09 19:56:36
函数参数看起来很奇怪。从Driver、S3OutputLocation和AwsRegion中删除[]。
发布于 2021-02-26 15:26:36
我通过验证R使用odbc::odbcListDrivers()识别的驱动程序列表,然后相应地调整Driver参数的名称来解决这个问题。如果R不能明确识别驱动程序,那么在.Renviron中设置ODBCSYSINI=/folder_that_contains_odbcinst.ini/就为我解决了问题。
https://stackoverflow.com/questions/63531052
复制相似问题