From e7720d5fae298e87616d6c2f2c7bbcc51880cd03 Mon Sep 17 00:00:00 2001 From: InvisibleProgrammer Date: Tue, 30 Jan 2024 17:12:45 +0100 Subject: [PATCH] Address review comments --- .../hive/ql/txn/compactor/handler/TestAbortedTxnCleaner.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/handler/TestAbortedTxnCleaner.java b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/handler/TestAbortedTxnCleaner.java index e552b083688e..1d31aae94343 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/handler/TestAbortedTxnCleaner.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/handler/TestAbortedTxnCleaner.java @@ -286,6 +286,9 @@ public void testCleaningOfAbortedDirectoriesBelowBase() throws Exception { Mockito.verifyNoInteractions(mockedFSRemover); Mockito.verify(mockedTaskHandler, Mockito.times(1)).getTasks(); + String compactionQueuePresence = "SELECT COUNT(*) FROM \"COMPACTION_QUEUE\" " + + " WHERE \"CQ_DATABASE\" = '" + dbName+ "' AND \"CQ_TABLE\" = '" + tableName + "' AND \"CQ_PARTITION\" IS NULL"; + Assert.assertEquals(1, TestTxnDbUtil.countQueryAgent(conf, compactionQueuePresence)); directories = getDirectories(conf, t, null); // Both base and delta files are present since the cleaner skips them as there is a newer write. @@ -327,6 +330,7 @@ public void testAbortedCleaningWithThreeTxnsWithDiffWriteIds() throws Exception addDeltaFile(t, null, writeId1, writeId1, 2); addDeltaFile(t, null, writeId2, writeId2, 2); + ms.abortTxns(Collections.singletonList(openTxnId2)); ms.commitTxn(openTxnId3); HiveConf.setIntVar(conf, HiveConf.ConfVars.HIVE_COMPACTOR_ABORTEDTXN_THRESHOLD, 0);