Skip to content

R JDBC Kerberos #57

Description

@darshanpandya-kogentix

Hello ,

I am trying to connect R to Hive (kerberos enabled) .. Please let me know if the following is the right approach. If yes, I am running into an issue which is not giving enough information to debug.

Thank you for your help in advance.

hadoop.class.path = list.files(path=c("/usr/hdp/2.6.2.0-205/hadoop"),pattern="jar", full.names=T);
hive.class.path = list.files(path=c("/usr/hdp/current/hive-client/lib"),pattern="jar", full.names=T);
hadoop.lib.path = list.files(path=c("/usr/hdp/current/hive-client/lib"),pattern="jar",full.names=T);
mapred.class.path = list.files(path=c("/usr/hdp/current/hadoop-mapreduce-client/lib"),pattern="jar",full.names=T);
cp = c(hive.class.path,hadoop.lib.path,mapred.class.path,hadoop.class.path)
.jinit(classpath=cp, parameters="-DRJDBC.debug=true")
drv <- JDBC("org.apache.hive.jdbc.HiveDriver","hive-jdbc.jar",identifier.quote="`")
conn <- dbConnect(drv, "jdbc:hive2://myserver.corp.server.com:10000/default;principal=hive/_HOST@CORP.server.COM","","")
Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :
java.lang.NoClassDefFoundError: Could not initialize class org.apache.hive.jdbc.HiveConnection

Metadata

Metadata

Assignees

Labels

documentationRequest for documentation or clarification

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions