@Test
  public void testNonAcidToAcidConversionWithNestedTableWithUnionSubdir() throws Exception {
    String dbName = "default";

    // Helper table for the union all insert
    String helperTblName = "helper_table";
    dropTables(driver, helperTblName);
    executeStatementOnDriver("create table " + helperTblName + " (a int, b int) stored as orc " +
            "TBLPROPERTIES ('transactional'='false')", driver);
    executeStatementOnDriver("insert into " + helperTblName + " values (1, 1), (2, 2)", driver);

    // Non acid nested table with union subdirs
    String tblName = "non_acid_nested";
    dropTables(driver, tblName);
    executeStatementOnDriver("create table " + tblName +
            "(a int, b int) partitioned by (p string, q string) stored as orc TBLPROPERTIES ('transactional'='false')", driver);

    // Insert some union data
    executeStatementOnDriver("insert into " + tblName + " partition(p='p1',q='q1') " +
            "select a,b from " + helperTblName + " union all select a,b from " + helperTblName, driver);

    // Some sanity checks
    List<String> result = execSelectAndDumpData("select * from " + tblName, driver, tblName);
    Assert.assertEquals(4, result.size());

    // Convert the table to acid
    executeStatementOnDriver("alter table " + tblName + " SET TBLPROPERTIES ('transactional'='true')", driver);

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

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

    Path tablePath = new Path(table.getSd().getLocation());

    // Partition lvl1
    FileStatus[] fileStatuses = fs.listStatus(tablePath);
    Assert.assertEquals(1, fileStatuses.length);
    String partitionName1 = fileStatuses[0].getPath().getName();
    Assert.assertEquals("p=p1", partitionName1);

    // Partition lvl2
    fileStatuses = fs.listStatus(new Path(table.getSd().getLocation() + "/" + partitionName1));
    Assert.assertEquals(1, fileStatuses.length);
    String partitionName2 = fileStatuses[0].getPath().getName();
    Assert.assertEquals("q=q1", partitionName2);

    // 1 base should be here
    fileStatuses = fs.listStatus(new Path(table.getSd().getLocation() + "/" + partitionName1 + "/" + partitionName2));
    Assert.assertEquals(1, fileStatuses.length);
    String baseName = fileStatuses[0].getPath().getName();
    Assert.assertEquals("base_10000000_v0000002", baseName);
  }
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