0

I am attempting to connect to Athena from RStudio using DBI::dbConnect, and I am having issues with opening the driver.

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

In addition, this code returns nothing.

sort((unique(odbcListDrivers()[[1]])))
character(0)

It appears that my ODBC driver is unaccessible or incorrectly installed, but I am having trouble understanding why. I have downloaded the driver and can see it in my library.

Any insight is greatly appreciated!

  • The error indicates that RStudio is not able to locate the driver . What machine do you have RStuido installed on and did you setup the ODBC driver as in https://db.rstudio.com/best-practices/drivers/#odbcinst.ini ? – Prabhakar Reddy Aug 22 '20 at 03:11
  • My RStudio is installed on MacOs 10.15.6 on my Macintosh HD disk. Athena does not require DSN, so I did not set up the odbcinst.ini or odbc.ini. – datascientist2117 Aug 24 '20 at 16:58

2 Answers2

0

The function arguments look strange. Remove the [] from Driver, S3OutputLocation and AwsRegion.

0

I solved by validating the list of driver that R recognizes using odbc::odbcListDrivers(), then adjusting the name of the Driver argument accordingly. If R can't definitely identify the driver, setting ODBCSYSINI=/folder_that_contains_odbcinst.ini/ in .Renviron solved for me.