diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java index d7149a7..2ae9cc0 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/FolderPermissionBase.java @@ -710,6 +710,9 @@ public void testTruncateTable() throws Exception { ret = driver.run("TRUNCATE TABLE " + tableName); Assert.assertEquals(0, ret.getResponseCode()); + assertExistence(warehouseDir + "/" + tableName); + verifyPermission(warehouseDir + "/" + tableName); + ret = driver.run("insert into table " + tableName + " partition(part1='1') select key,value from mysrc where part1='1' and part2='1'"); Assert.assertEquals(0, ret.getResponseCode()); @@ -717,6 +720,13 @@ public void testTruncateTable() throws Exception { assertExistence(partition); verifyPermission(partition); + + // Also test the partition folder if the partition is truncated + ret = driver.run("TRUNCATE TABLE " + tableName + " partition(part1='1')"); + Assert.assertEquals(0, ret.getResponseCode()); + + assertExistence(partition); + verifyPermission(partition); } private void setSinglePartition(String tableLoc, int index) throws Exception {