@Test
  public void testIfEmptyBaseIsPresentAfterCompaction() throws Exception {
    String dbName = "default";
    String tblName = "empty_table";

    // Setup of LOAD INPATH scenario.
    dropTables(driver, tblName);
    executeStatementOnDriver("create table " + tblName + " (a string) stored as orc " +
            "TBLPROPERTIES ('transactional'='true')", driver);
    executeStatementOnDriver("insert into " + tblName + " values ('a')", driver);
    executeStatementOnDriver("delete from " + tblName + " where a='a'", driver);

    // Run a query-based MAJOR compaction
    CompactorTestUtil.runCompaction(conf, dbName, tblName, CompactionType.MAJOR, true);
    // Clean up resources
    CompactorTestUtil.runCleaner(conf);

    IMetaStoreClient hmsClient = new HiveMetaStoreClient(conf);
    Table table = hmsClient.getTable(dbName, tblName);
    FileSystem fs = FileSystem.get(conf);

    FileStatus[] fileStatuses = fs.listStatus(new Path(table.getSd().getLocation()));
    // There should be only dir
    Assert.assertEquals(1, fileStatuses.length);
    Path basePath = fileStatuses[0].getPath();
    // And it's a base
    Assert.assertTrue(AcidUtils.baseFileFilter.accept(basePath));
    RemoteIterator<LocatedFileStatus> filesInBase = fs.listFiles(basePath, true);
    // It has no files in it
    Assert.assertFalse(filesInBase.hasNext());
  }
Tests whether hive.llap.io.etl.skip.format config is handled properly whenever QueryCompactor#runCompactionQueries
is invoked.
@throws Exception
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/TestCrudCompactorOnTez.java