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


##########
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:
   - didn't you return 'true' in isOwner() when table doesn't exist in your 
initial patch and set the owner privilege? 
   - note, that hivePrivObject.getType() might not be always a TABLE_OR_VIEW, 
could be DB as well. 



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