maheshk114 commented on code in PR #3264:
URL: https://github.com/apache/hive/pull/3264#discussion_r868746322
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java:
##########
@@ -5008,11 +5009,25 @@ static private boolean needToCopy(final HiveConf conf,
Path srcf, Path destf, Fi
boolean isOwned = FileUtils.isOwnerOfFileHierarchy(srcFs, srcs,
configuredOwner, false);
if (configuredOwner.equals(runningUser)) {
// Check if owner has write permission, else it will have to copy
+ UserGroupInformation ugi = Utils.getUGI();
+ String currentUser = ugi.getShortUserName();
+ FileSystem fsAsUser = null;
+ UserGroupInformation proxyUser = null;
+ if (configuredOwner != null && !configuredOwner.equals(currentUser))
{
+ proxyUser = UserGroupInformation.createProxyUser(configuredOwner,
UserGroupInformation.getLoginUser());
Review Comment:
I think this can be done in two ways ..
1. Use a common function to get proxy user and then in getFsAsUser use null
check for proxy user
2. Use a Pair to return
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]