You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/08/22 16:10:39 UTC

[GitHub] [hive] veghlaci05 commented on a diff in pull request #3532: HIVE-26482: Add test to check names after compaction on partition

veghlaci05 commented on code in PR #3532:
URL: https://github.com/apache/hive/pull/3532#discussion_r951624999


##########
ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands2.java:
##########
@@ -3264,6 +3264,37 @@ public void testNoTxnComponentsForScheduledQueries() throws Exception {
     Assert.assertEquals(resData, stringifyValues(actualData));
   }
 
+  @Test
+  public void testCompactionOutputDirectoryNamesOnPartitions() throws Exception {
+    String p1 = "p=p1";
+    String p2 = "p=p2";
+    String expectedDelta1 = p1 + "/delta_0000001_0000002_v0000021";
+    String expectedDelta2 = p2 + "/delta_0000003_0000004_v0000022";
+
+    runStatementOnDriver("insert into " + Table.ACIDTBLPART + " partition(p='p1') (a,b) values(1,2)");
+    runStatementOnDriver("insert into " + Table.ACIDTBLPART + " partition(p='p1') (a,b) values(3,4)");
+    runStatementOnDriver("insert into " + Table.ACIDTBLPART + " partition(p='p2') (a,b) values(1,2)");
+    runStatementOnDriver("insert into " + Table.ACIDTBLPART + " partition(p='p2') (a,b) values(3,4)");
+
+    compactPartition(Table.ACIDTBLPART.name().toLowerCase(), CompactionType.MINOR, p1);
+    compactPartition(Table.ACIDTBLPART.name().toLowerCase(), CompactionType.MINOR, p2);
+
+    FileSystem fs = FileSystem.get(hiveConf);
+    String tablePath = getWarehouseDir() + "/" + Table.ACIDTBLPART.name().toLowerCase() + "/";
+
+    Assert.assertTrue(fs.exists(new Path(tablePath + expectedDelta1)));
+    Assert.assertTrue(fs.exists(new Path(tablePath + expectedDelta2)));

Review Comment:
   Maybe adding an extra assertion, that there are no other folders on the filesystem?



-- 
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: gitbox-unsubscribe@hive.apache.org

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


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