deniskuzZ commented on code in PR #3247:
URL: https://github.com/apache/hive/pull/3247#discussion_r906420448


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/sqlstd/SQLAuthorizationUtils.java:
##########
@@ -211,8 +211,15 @@ static RequiredPrivileges 
getPrivilegesFromMetaStore(IMetaStoreClient metastoreC
     RequiredPrivileges privs = getRequiredPrivsFromThrift(thrifPrivs);
 
     // add owner privilege if user is owner of the object
-    if (isOwner(metastoreClient, userName, curRoles, hivePrivObject)) {
-      privs.addPrivilege(SQLPrivTypeGrant.OWNER_PRIV);
+    try {
+      if (metastoreClient.tableExists(hivePrivObject.getDbname(), 
hivePrivObject.getObjectName()) &&

Review Comment:
   Wait, don't you need to add the privilege when the table DOESN'T exist? 
   Also won't it hide the problem with the non-existing table for other 
operations besides RENAME? Can we check somehow that we are within the rename 
operation context?



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