It was actually down to the hive server2 not being started in Cloudera and me trying to use the driver for hive server 2 Class.forName("org.apache.hive.jdbc.HiveDriver");
instead of the hive server driver Class.forName("org.apache.hadoop.hive.jdbc.HiveDriver");
.
Hive impersonation not working with jdbc
Question
I'm trying to connect to a Hive Server implemented through Cloudera with the jdbc-connector and the connection fails at the impersonation point :
14/05/13 10:45:10 INFO hive.metastore: Connected to metastore.
14/05/13 10:45:10 WARN conf.Configuration: org.apache.hadoop.hive.conf.LoopingByteArrayInputStream@2f490758:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/05/13 10:45:10 WARN conf.Configuration: org.apache.hadoop.hive.conf.LoopingByteArrayInputStream@2f490758:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
org.apache.hive.service.cli.HiveSQLException: No username provided for impersonation
at org.apache.hive.service.cli.session.HiveSessionImplwithUGI.setSessionUGI(HiveSessionImplwithUGI.java:57)
at org.apache.hive.service.cli.session.HiveSessionImplwithUGI.<init>(HiveSessionImplwithUGI.java:49)
at org.apache.hive.service.cli.session.SessionManager.openSession(SessionManager.java:83)
at org.apache.hive.service.cli.CLIService.openSessionWithImpersonation(CLIService.java:118)
at org.apache.hive.service.cli.thrift.ThriftCLIService.OpenSession(ThriftCLIService.java:157)
at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:255)
at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:150)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:106)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
[...]
java.sql.SQLException: No username provided for impersonation
I've checked the cloudera web interface and impersonation in enabled on hive, and the proxy settings for hdfs and MapReduce are correctly set to "*". My hive-site.xml also contains
<property>
<name>hive.server2.enable.impersonation</name>
<value>true</value>
</property>
Does anyone know where that could come from?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow