You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/[email protected]","","")
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
The text was updated successfully, but these errors were encountered:
I know this is a bit of an old issue, but I recently had to set up a connection using Kerberos. To get it to work before creating the driver, I had to create a UserGroupInformation class and use the loginUserFromKeytab method. Something along the lines of:
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.
The text was updated successfully, but these errors were encountered: