Unable to integrate rstudio to hive

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:

  1. Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
  2. java.lang.NoClassDefFoundError: Could not initialize class org.apache.hive.service.auth.HiveAuthFactory

Hi, maybe you can consider using ODBC drivers instead of JDBC, they're easier to setup:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.