Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

RStudio And Hive

Solved Go to solution
Highlighted

RStudio And Hive

Super 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

Accepted Solutions

Re: RStudio And Hive

Super 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.

2 REPLIES 2

Re: RStudio And Hive

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

Re: RStudio And Hive

Super 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.