ramazon-athenarjdbc

RJDBC not finding driver class


I am trying to access athena through RJDBCpackage, but I keep getting the following error:

.jclassLoader()$setDebug(1L) 

drv <- JDBC(driverClass = "com.amazonaws.athena.jdbc.AthenaDriver",
            "C:/Users/falvarenga/Downloads/AthenaJDBC42_2.0.7.jar",
            identifier.quote="'")

RJavaClassLoader: added 'C:/Users/falvarenga/Downloads/AthenaJDBC42_2.0.7.jar' to the URL class path loader
RJavaClassLoader: adding Java archive file 'C:/Users/falvarenga/Downloads/AthenaJDBC42_2.0.7.jar' to the internal class path
RJavaClassLoader: added 'C:/Users/falvarenga/Documents/R/R-3.5.3/library/RJDBC/java/RJDBC.jar' to the URL class path loader
RJavaClassLoader: adding Java archive file 'C:/Users/falvarenga/Documents/R/R-3.5.3/library/RJDBC/java/RJDBC.jar' to the internal class path
RJavaClassLoader@33909752.findClass(com.amazonaws.athena.jdbc.AthenaDriver)
 - URL loader did not find it: java.lang.ClassNotFoundException: com.amazonaws.athena.jdbc.AthenaDriver
RJavaClassLoader.findClass("com.amazonaws.athena.jdbc.AthenaDriver")
 - trying class path "C:\Users\falvarenga\Documents\R\R-3.5.3\library\rJava\java"
   Directory, can get 'C:\Users\falvarenga\Documents\R\R-3.5.3\library\rJava\java\com\amazonaws\athena\jdbc\AthenaDriver.class'? NO
 - trying class path "C:\Users\falvarenga\Downloads\AthenaJDBC42_2.0.7.jar"
   JAR file, can get 'com/amazonaws/athena/jdbc/AthenaDriver'? NO
 - trying class path "C:\Users\falvarenga\Documents\R\R-3.5.3\library\RJDBC\java\RJDBC.jar"
   JAR file, can get 'com/amazonaws/athena/jdbc/AthenaDriver'? NO
    >> ClassNotFoundException 

What am I missing here?


Solution

  • I created the AWR.Athena package to manage the jar / classpath setup when using DBI + rJava, you could try it out.

    install.packages("AWR.Athena")