dengzhhu653 commented on code in PR #4276:
URL: https://github.com/apache/hive/pull/4276#discussion_r1285469486


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizerV2.java:
##########
@@ -201,8 +201,7 @@ private static void addHivePrivObject(Entity privObject, 
Map<String, List<String
           HiveConf.ConfVars.HIVE_AUTHORIZATION_TABLES_ON_STORAGEHANDLERS)) {
         //TODO: add hive privilege object for storage based handlers for 
create and alter table commands.
         if (hiveOpType == HiveOperationType.CREATETABLE ||
-                hiveOpType == HiveOperationType.ALTERTABLE_PROPERTIES ||
-                hiveOpType == HiveOperationType.CREATETABLE_AS_SELECT) {

Review Comment:
   Based on the context, I would change the condition to 
   ```java
    if (privObject instanceof WriteEntity &&
        hiveOpType == HiveOperationType.CREATETABLE ||
        hiveOpType == HiveOperationType.ALTERTABLE_PROPERTIES ||
        hiveOpType == HiveOperationType.CREATETABLE_AS_SELECT) {
   ```
   
   We can also put the sql tests into 
[authorization_privilege_objects.q](https://github.com/apache/hive/pull/4258/files#diff-33e2722b84caead2f6aa2ea1c20a3c8a5d90d7adef87f6923a3e21dbafb7206b),
 so that we can see the privilege object after applying the changes.



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