private void testMinorCompactionWithoutBucketsCommon(String dbName, String tableName, String tempTableName,
      boolean insertOverWrite, List<String> expectedDeltas, List<String> expectedDeleteDeltas,
      String expectedCompactedDeltaDirName, CompactionType compactionType) throws Exception {

    TestDataProvider dataProvider = new TestDataProvider();
    dataProvider.createTableWithoutBucketWithMultipleSplits(dbName, tableName, tempTableName, true, true,
        insertOverWrite);

    FileSystem fs = FileSystem.get(conf);
    Table table = msClient.getTable(dbName, tableName);

    List<String> expectedData = dataProvider.getAllData(tableName);
    List<String> expectedFileNames = dataProvider.getDataWithInputFileNames(null, tableName);

    // Verify deltas
    Assert.assertEquals("Delta directories does not match", expectedDeltas,
        CompactorTestUtil.getBaseOrDeltaNames(fs, AcidUtils.deltaFileFilter, table, null));
    // Verify delete delta
    Assert.assertEquals("Delete directories does not match", expectedDeleteDeltas,
        CompactorTestUtil.getBaseOrDeltaNames(fs, AcidUtils.deleteEventDeltaDirFilter, table, null));

    List<String> expectedBucketFiles =
        CompactorTestUtil.getBucketFileNamesWithoutAttemptId(fs, table, null, expectedDeltas);
    List<String> expectedDeleteBucketFiles =
        CompactorTestUtil.getBucketFileNamesWithoutAttemptId(fs, table, null, expectedDeleteDeltas);

    CompactorTestUtil.runCompaction(conf, dbName, tableName, compactionType, true);
    // Clean up resources
    CompactorTestUtil.runCleaner(conf);

    // Only 1 compaction should be in the response queue with succeeded state
    List<ShowCompactResponseElement> compacts =
        TxnUtils.getTxnStore(conf).showCompact(new ShowCompactRequest()).getCompacts();
    Assert.assertEquals("Completed compaction queue must contain one element", 1, compacts.size());
    Assert.assertEquals("Compaction state is not succeeded", "succeeded", compacts.get(0).getState());

    // Verify delta and delete delta directories after compaction
    if (CompactionType.MAJOR == compactionType) {
      List<String> actualBasesAfterComp =
          CompactorTestUtil.getBaseOrDeltaNames(fs, AcidUtils.baseFileFilter, table, null);
      Assert.assertEquals("Base directory does not match after compaction",
          Collections.singletonList(expectedCompactedDeltaDirName), actualBasesAfterComp);
      // Verify bucket files in delta and delete delta dirs
      Assert.assertEquals("Bucket names are not matching after compaction in the base folder",
          expectedBucketFiles, CompactorTestUtil.getBucketFileNames(fs, table, null, actualBasesAfterComp.get(0)));
    } else {
      List<String> actualDeltasAfterComp =
          CompactorTestUtil.getBaseOrDeltaNames(fs, AcidUtils.deltaFileFilter, table, null);
      Assert.assertEquals("Delta directories does not match after compaction",
          Collections.singletonList(expectedCompactedDeltaDirName), actualDeltasAfterComp);
      List<String> actualDeleteDeltasAfterComp =
          CompactorTestUtil.getBaseOrDeltaNames(fs, AcidUtils.deleteEventDeltaDirFilter, table, null);
      Assert.assertEquals("Delete delta directories does not match after compaction",
          Collections.singletonList("delete_" + expectedCompactedDeltaDirName), actualDeleteDeltasAfterComp);
      // Verify bucket files in delta and delete delta dirs
      Assert.assertEquals("Bucket names are not matching after compaction in the delete deltas",
          expectedDeleteBucketFiles,
          CompactorTestUtil.getBucketFileNames(fs, table, null, actualDeleteDeltasAfterComp.get(0)));
      Assert.assertEquals("Bucket names are not matching after compaction", expectedBucketFiles,
          CompactorTestUtil.getBucketFileNames(fs, table, null, actualDeltasAfterComp.get(0)));
    }

    // Verify all contents
    List<String> actualData = dataProvider.getAllData(tableName);
    Assert.assertEquals(expectedData, actualData);
    List<String> actualFileNames = dataProvider.getDataWithInputFileNames(null, tableName);
    Assert.assertTrue(dataProvider.compareFileNames(expectedFileNames, actualFileNames));
    dataProvider.dropTable(tableName);
  }
TestDataProvider uses 2 buckets, I want to test 4 buckets here.
@throws Exception
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/TestCrudCompactorOnTez.java