Our team just upgraded to HiveServer2 (on MapR) with security. I can log into the DB via beeline fine and do select statements:
beeline> !connect jdbc:hive2://
Enter username for djbc:hive2://: <username>
Enter password for jdbc:hive2://: **********
beeline> use test;
beeline> select * from foo;
I'm using Talend (a java-code generator) to attempt to connect to HiverServer2, but I receive the following error message:
Exception in component tHiveConnection_3
java.sql.SQLException: Error while compiling statement: FAILED: SemanticException No valid privileges
Required privileges for this query: Server=HS2->Db=test->Table=*->action=insert;Server=HS2->Db=test->Table=*->action=select;
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:121)
at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:109)
at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:233)
at org.apache.hive.jdbc.HiveConnection.configureConnection(HiveConnection.java:451)
at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:195)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at talend56test.testhiveryan2_0_1.TestHiveRyan2.tHiveConnection_3Process(TestHiveRyan2.java:2493)
I find it a bit confusing because I can log into beeline with the same username/password/database that I give to Talend, yet Talend is throwing a privilege error.
Looking at the Talend Generated code for line 2492 (tHiveConnection_3), I can see that the following java code causes the error:
conn_tHiveConnection_3 = java.sql.DriverManager.getConnection(
url_tHiveConnection_3, dbUser_tHiveConnection_3,
dbPwd_tHiveConnection_3);
url_tHiveConnection_3 is a string with a value like this: "jdbc:hive2://myhost:10000/test
;
dbUser_tHiveConnection_3 is a string containing my username.
dbPwd_tHiveConnection_3 is a string containing my password
Any ideas on what is causing this error?