library(DBI)
library(rJava)
library(RJDBC)
.jaddClassPath("/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/jars/hive-jdbc-1.1.0-cdh5.16.1.jar")
.jaddClassPath("/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/jars/hive-jdbc-1.1.0-cdh5.16.1-standalone.jar")
.jaddClassPath("/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/jars/hive-metastore-1.1.0-cdh5.16.1.jar")
.jaddClassPath("/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/jars/hive_metastore.jar")
.jaddClassPath("/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/jars/hadoop-common-2.6.0-cdh5.16.1.jar")
drv <- JDBC("org.apache.hive.jdbc.HiveDriver","/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/jars/hive-jdbc-1.1.0-cdh5.16.1.jar", identifier.quote=" ")
conn <- dbConnect(drv, "jdbc:hive2://3.14.23.73:10000/mldb;","user", "******")
show_databases <- dbGetQuery(conn,"show databases")
Error:
- Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.hive.service.auth.HiveAuthFactory