使用Java JDBC连接到Hive时出现org.apache.hadoop.ipc.RemoteException

时间:2018-03-28 13:59:50

标签: java hive

我的hiveserver2已启动&运行。我尝试使用Java JDBC连接到hive

Class.forName("org.apache.hive.jdbc.HiveDriver");
Connection con = DriverManager.getConnection("jdbc:hive2://localhost:10000/sample", "", "");

我面临以下异常

Exception in thread "main" org.apache.hive.service.cli.HiveSQLException: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: hduser is not allowed to impersonate anonymous

0 个答案:

没有答案