Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

RStudio And Hive

avatar
Master Collaborator

Hi:

I am integrating R and hive, and when i execute this code y have this error:

library(rmr2)
library(plyrmr)
library(rJava)
library(RJDBC)
library(DBI)

Sys.setenv("HADOOP_CMD"="/usr/hdp/2.3.2.0-2950/hadoop/bin/hadoop")
Sys.setenv("HADOOP_HOME"="/usr/hdp/2.3.2.0-2950/hadoop")
Sys.setenv("HADOOP_PREFIX"="/usr/hdp/2.3.2.0-2950/hadoop")
Sys.setenv("HADOOP_CONF_DIR"="/usr/hdp/2.3.2.0-2950/hadoop/conf")
Sys.setenv("HIVE_HOME"="/usr/hdp/current/hive-client/lib") 

options( java.parameters = "-Xmx8g" )
drv <- JDBC("org.apache.hive.jdbc.HiveDriver", "/usr/hdp/current/hive-client/lib/hive-jdbc.jar")
conn <- dbConnect(drv, "jdbc:hive2://10.1.246.19:10000/default", "******", "*******")

Feb 02, 2016 10:12:10 AM org.apache.hive.jdbc.Utils parseURLFeb 02, 2016 10:12:10 AM org.apache.hive.jdbc.Utils parseURLINFO: Resolved authority: 10.1.246.19:10000Feb 02, 2016 10:12:10 AM org.apache.hive.jdbc.Utils parseURLINFO: Supplied authorities: 10.1.246.19:10000Feb 02, 2016 10:12:10 AM org.apache.hive.jdbc.Utils parseURLINFO: Resolved authority: 10.1.246.19:10000Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], : java.lang.NoClassDefFoundError: org/apache/hadoop/conf/Configuration

1 ACCEPTED SOLUTION

avatar
Master Collaborator

Hi:

i have resolved the problem adding the jar file into the hadoop path in the Namenode server

/usr/hdp/2.3.2.0-2950/hadoop/lib/hadoop-client-2.7.1.jar

Regards.

View solution in original post

2 REPLIES 2

avatar
Master Guru

Yeah I think they missed a couple common jars in the hive-jdbc.jar

I had to add two more jars to the classpath:

From HDP_INSTALLATION/hive/lib ( hive-jdbc.jar and commons-loggingxxx.jar )

From HDP_INSTALLATION/hadoop/hadoop-commonxxx.jar

https://community.hortonworks.com/articles/594/connecting-eclipse-to-hive.html

avatar
Master Collaborator

Hi:

i have resolved the problem adding the jar file into the hadoop path in the Namenode server

/usr/hdp/2.3.2.0-2950/hadoop/lib/hadoop-client-2.7.1.jar

Regards.