aasha commented on a change in pull request #1007:
URL: https://github.com/apache/hive/pull/1007#discussion_r422932739



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeSynchronizer.java
##########
@@ -95,16 +103,28 @@ private void addACLsToBag(
                         (int) (System.currentTimeMillis() / 1000), GRANTOR, 
PrincipalType.USER, false), authorizer));
             break;
           case COLUMN:
-            privBag.addToPrivileges(
-                new HiveObjectPrivilege(new 
HiveObjectRef(HiveObjectType.COLUMN, dbName, tblName, null, columnName),
-                    principal, principalType, new 
PrivilegeGrantInfo(acl.getKey().toString(),
-                        (int) (System.currentTimeMillis() / 1000), GRANTOR, 
PrincipalType.USER, false), authorizer));
+
+            int privilegeBit = acl.getKey().ordinal();
+            columnPrivilegeBits[privilegeBit] = 
columnPrivilegeBits[privilegeBit] == 0 ? 1 : 0;

Review comment:
       This extra conditional check is not needed. Can set it to 1 directly




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to