@Test
  public void testAcidTablesBootstrapWithMinorCompaction() throws Throwable {
    String tableName = testName.getMethodName();
    String tableNamepart = testName.getMethodName() + "_part";
    primary.run("use " + primaryDbName)
            .run("create table " + tableName + " (id int) clustered by(id) into 3 buckets stored as orc " +
                    "tblproperties (\"transactional\"=\"true\")")
            .run("insert into " + tableName + " values(1)")
            .run("insert into " + tableName + " values(2)")
            .run("create table " + tableNamepart + " (id int) partitioned by (part int) clustered by(id) " +
                    "into 3 buckets stored as orc " +
                    "tblproperties (\"transactional\"=\"true\") ")
            .run("insert into " + tableNamepart + " values(1, 2)")
            .run("insert into " + tableNamepart + " values(2, 2)");

    runCompaction(primaryDbName, tableName, null, CompactionType.MINOR);

    List<Partition> partList = primary.getAllPartitions(primaryDbName, tableNamepart);
    for (Partition part : partList) {
      Table tbl = primary.getTable(primaryDbName, tableNamepart);
      String partName = Warehouse.makePartName(tbl.getPartitionKeys(), part.getValues());
      runCompaction(primaryDbName, tableNamepart, partName, CompactionType.MINOR);
    }
    List<String> withClause = Arrays.asList(
            "'" + HiveConf.ConfVars.REPL_RUN_DATA_COPY_TASKS_ON_TARGET.varname + "'='true'");

    WarehouseInstance.Tuple dump = primary.dump(primaryDbName, withClause);
    replica.load(replicatedDbName, primaryDbName, withClause);
    replica.run("use " + replicatedDbName)
            .run("show tables")
            .verifyResults(new String[]{tableName, tableNamepart})
            .run("repl status " + replicatedDbName)
            .verifyResult(dump.lastReplicationId)
            .run("select id from " + tableName + " order by id")
            .verifyResults(new String[]{"1", "2"})
            .run("select id from " + tableNamepart + " order by id")
            .verifyResults(new String[]{"1", "2"});

    FileStatus[] fileStatuses = getDirsInTableLoc(primary, primaryDbName, tableName);
    assertTrue(-1 != getMinorCompactedTxnId(fileStatuses));

    fileStatuses = getDirsInTableLoc(replica, replicatedDbName, tableName);
    Assert.assertEquals(-1, getMinorCompactedTxnId(fileStatuses));

    // check for partitioned table.
    for (Partition part : partList) {
      fileStatuses = getDirsInPartitionLoc(primary, part);
      assertTrue(-1 != getMinorCompactedTxnId(fileStatuses));
      Partition partReplica = replica.getPartition(replicatedDbName, tableNamepart, part.getValues());
      fileStatuses = getDirsInPartitionLoc(replica, partReplica);
      assertTrue(-1 == getMinorCompactedTxnId(fileStatuses));
    }
  }
Testcase for getting immutable dataset dump, and its corresponding repl load.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java