mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Added property to disable hive user impersonation
This commit is contained in:
parent
7976f5b9ec
commit
d6f0c625c5
1 changed files with 11 additions and 5 deletions
|
|
@ -374,16 +374,22 @@ public class JDBCInterpreter extends Interpreter {
|
|||
if (lastIndexOfUrl == -1) {
|
||||
lastIndexOfUrl = connectionUrl.length();
|
||||
}
|
||||
connectionUrl.insert(lastIndexOfUrl, ";hive.server2.proxy.user=" + user + ";");
|
||||
if (!property.getProperty("hive.proxy.user").equals("false")){
|
||||
logger.debug("Using hive proxy user");
|
||||
connectionUrl.insert(lastIndexOfUrl, ";hive.server2.proxy.user=" + user + ";");
|
||||
}
|
||||
connection = getConnectionFromPool(connectionUrl.toString(),
|
||||
user, propertyKey, properties);
|
||||
user, propertyKey, properties);
|
||||
} else {
|
||||
UserGroupInformation ugi = null;
|
||||
|
||||
try {
|
||||
ugi = UserGroupInformation.createProxyUser(user,
|
||||
UserGroupInformation.getCurrentUser());
|
||||
ugi = property.getProperty("hive.proxy.user").equals("false") ?
|
||||
UserGroupInformation.getCurrentUser() :
|
||||
UserGroupInformation.createProxyUser(
|
||||
user, UserGroupInformation.getCurrentUser());
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in createProxyUser", e);
|
||||
logger.error("Error in getCurrentUser or createProxyUser", e);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append(e.getMessage()).append("\n");
|
||||
stringBuilder.append(e.getCause());
|
||||
|
|
|
|||
Loading…
Reference in a new issue