[
https://issues.apache.org/jira/browse/HIVE-13532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16128399#comment-16128399
]
feiwei commented on HIVE-13532:
-------------------------------
you can do this in MapredLocalTask.java
UserGroupInformation ug = Utils.getUGI().getRealUser();
String endUserName = "";
if(ug == null){
endUserName = Utils.getUGI().getShortUserName();
}
else{
endUserName = ug.getShortUserName();
}
or
String endUserName = "";
UserGroupInformation ug1 = Utils.getUGI();
if (ug1.getAuthenticationMethod().equals(AuthenticationMethod.PROXY)){
endUserName = ug.getRealUser().getShortUserName();
}
else{
endUserName = ug.getShortUserName();
}
because when getAuthenticationMethod() return is not PROXY, getRealUser() will
return null.
> Mapjoin should set realuser's username
> --------------------------------------
>
> Key: HIVE-13532
> URL: https://issues.apache.org/jira/browse/HIVE-13532
> Project: Hive
> Issue Type: Bug
> Affects Versions: 1.1.0
> Environment: HADOOP_PROXY_USER is set.
> Reporter: Zhiwen Sun
>
> Map join set HADOOP_USER_NAME should be realuser's username.
> Current, hive set HADOOP_USER_NAME env for mapjoin local process according:
> {quote}
> String endUserName = Utils.getUGI().getShortUserName();
> {quote}
> suppose set HADOOP_PROXY_USER=abc in shell.
> map join local job will have following env:
> {quote}
> HADOOP_USER_NAME=abc
> HADOOP_PROXY_NAME=abc
> {quote}
> this will cause such exception:
> {quote}
> java.io.IOException:
> org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException):
> User: abc is not allowed to impersonate
> {quote}
> I think we should set HADOOP_USER_NAME to realuser:
> {quote}
> String endUserName = Utils.getUGI().getRealUser().getShortUserName();
> {quote}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)