@Test
  public void testNoDeltaAfterDeleteAndMinorCompaction() throws Exception {
    String tableName = "test_major_delete_minor";

    runStatementOnDriver("drop table if exists " + tableName);
    runStatementOnDriver("create table " + tableName + " (name VARCHAR(50), age TINYINT, num_clicks BIGINT) stored as orc" +
            " tblproperties ('transactional'='true')");
    runStatementOnDriver("insert into " + tableName + " values ('amy', 35, 12341234)");
    runStatementOnDriver("insert into " + tableName + " values ('bob', 66, 1234712348712)");
    runStatementOnDriver("insert into " + tableName + " values ('cal', 21, 431)");
    runStatementOnDriver("insert into " + tableName + " values ('fse', 28, 8456)");
    runStatementOnDriver("alter table " + tableName + " compact 'major'");
    runWorker(hiveConf);
    runCleaner(hiveConf);
    runStatementOnDriver("delete from " + tableName + " where name='bob'");
    runStatementOnDriver("delete from " + tableName + " WHERE name='fse'");
    runStatementOnDriver("alter table " + tableName + " compact 'minor'");
    runWorker(hiveConf);
    runCleaner(hiveConf);

    FileSystem fs = FileSystem.get(hiveConf);
    FileStatus[] fileStatuses = fs.globStatus(new Path(getWarehouseDir() + "/" + tableName + "/*"));
    for(FileStatus fileStatus : fileStatuses) {
      Assert.assertFalse(fileStatus.getPath().getName().startsWith(AcidUtils.DELTA_PREFIX));
    }
  }
This tests that delete_delta_x_y dirs will be not produced during minor compaction if no input delete events.
See HIVE-20941.
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands2.java