ramesh0201 commented on code in PR #3264:
URL: https://github.com/apache/hive/pull/3264#discussion_r868772549


##########
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 used the option 1 :)



-- 
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]

Reply via email to