private static void runCompactorThread(HiveConf hiveConf, CompactorThreadType type, String poolName)
      throws Exception {
    AtomicBoolean stop = new AtomicBoolean(true);
    CompactorThread t;
    switch (type) {
      case INITIATOR:
        t = new Initiator();
        break;
      case WORKER:
        t = new Worker();
        if (poolName != null && !poolName.equals(Constants.COMPACTION_DEFAULT_POOL)) {
          ((Worker)t).setPoolName(poolName); 
        }
        break;
      case CLEANER:
        t = new Cleaner();
        break;
      default:
        throw new IllegalArgumentException("Unknown type: " + type);
    }
    t.setConf(hiveConf);
    t.init(stop);
    t.run();
  }
takes raw data and turns it into a string as if from Driver.getResults()
sorts rows in dictionary order
ql/src/test/org/apache/hadoop/hive/ql/TxnCommandsBaseForTests.java