saihemanth-cloudera commented on code in PR #4893:
URL: https://github.com/apache/hive/pull/4893#discussion_r1412697056
##########
ql/src/test/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHivePrivilegeObjectOwnerNameAndType.java:
##########
@@ -145,6 +147,19 @@ public void testOwnerType() throws Exception {
Assert.assertTrue(containsOwnerType);
}
+ @Test
+ public void testActionTypeForPartitionedTable() throws Exception {
+ runCmd("CREATE EXTERNAL TABLE Part (eid int, name int) PARTITIONED BY
(position int, dept int)");
+ reset(mockedAuthorizer);
+ runCmd("insert overwrite table part partition(position=2,DEPT) select
2,2,2");
+ Pair<List<HivePrivilegeObject>, List<HivePrivilegeObject>> io =
getHivePrivilegeObjectInputs();
+ List<HivePrivilegeObject> hpoList = io.getValue();
+ Assert.assertFalse(hpoList.isEmpty());
+ for (HivePrivilegeObject hpo : hpoList) {
+ Assert.assertEquals(hpo.getActionType(),
HivePrivilegeObject.HivePrivObjectActionType.INSERT_OVERWRITE);
+ }
+ }
Review Comment:
Can you add another test, which inserts 4/5 partitions into a table but we
should only see one hive privilege object?
--
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]