@Override
  public boolean run(CompactorContext context) throws IOException {
    HiveConf hiveConf = context.getConf();
    Table table = context.getTable();
    AcidDirectory dir = context.getAcidDirectory();
    LOG.debug(
        "Going to delete directories for aborted transactions for MM table " + table.getDbName()
            + "." + table.getTableName());
    QueryCompactor.Util.removeFilesForMmTable(hiveConf, dir);
    StorageDescriptor storageDescriptor = context.getSd();
    ValidWriteIdList writeIds = context.getValidWriteIdList();

    // Set up the session for driver.
    HiveConf driverConf = setUpDriverSession(hiveConf);

    String tmpTableName = getTempTableName(table);
    String resultTmpTableName = tmpTableName + "_result";
    Path resultDeltaDir = QueryCompactor.Util.getCompactionResultDir(storageDescriptor, writeIds, driverConf,
        false, false, false, dir);

    List<String> createTableQueries = getCreateQueries(tmpTableName, table, storageDescriptor, dir,
        writeIds, resultDeltaDir);
    List<String> compactionQueries = getCompactionQueries(tmpTableName, resultTmpTableName, table);
    List<String> dropQueries = getDropQueries(tmpTableName);
    runCompactionQueries(driverConf, tmpTableName, context.getCompactionInfo(), Lists.newArrayList(resultDeltaDir), 
        createTableQueries, compactionQueries, dropQueries, table.getParameters());
    return true;
  }
Run a minor query compaction on an insert only (MM) table.
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/MmMinorQueryCompactor.java