saihemanth-cloudera commented on code in PR #3247:
URL: https://github.com/apache/hive/pull/3247#discussion_r909613946
##########
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:
I don't think we would need any privileges when the table doesn't exist.
That's the reason why we are moving this piece of code out of isOwner() method.
We don't have any information on what type of operation is this at that point.
Also, this check is about whether we need to assign owner privileges to the
current user or not, when the table itself doesn't exist there is no point in
assigning ownership privileges irrespective of operation.
--
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]