@Override
  protected HiveConf setUpDriverSession(HiveConf hiveConf) {
    HiveConf conf = super.setUpDriverSession(hiveConf);
    /*
     * For now, we will group splits on tez so that we end up with all bucket files,
     * with same bucket number in one map task.
     */
    conf.set(HiveConf.ConfVars.SPLIT_GROUPING_MODE.varname, CompactorUtil.COMPACTOR);
    return conf;
  }
Class responsible of running query based major compaction.
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/MajorQueryCompactor.java