public Multimap<Integer, InputSplit> generateGroupedSplits(JobConf jobConf, Configuration conf, InputSplit[] splits,
      float waves, int availableSlots, String inputName, boolean groupAcrossFiles,
      SplitLocationProvider locationProvider) throws Exception {
    boolean isMinorCompaction = true;
    MapWork mapWork = populateMapWork(jobConf, inputName);
    // ArrayListMultimap is important here to retain the ordering for the splits.
    Multimap<Integer, InputSplit> schemaGroupedSplitMultiMap = ArrayListMultimap.<Integer, InputSplit> create();
    if (HiveConf.getVar(jobConf, HiveConf.ConfVars.SPLIT_GROUPING_MODE).equalsIgnoreCase("compactor")) {
      List<Path> paths = Utilities.getInputPathsTez(jobConf, mapWork);
      for (Path path : paths) {
        List<String> aliases = mapWork.getPathToAliases().get(path);
        if ((aliases != null) && (aliases.size() == 1)) {
          Operator<? extends OperatorDesc> op = mapWork.getAliasToWork().get(aliases.get(0));
          if ((op != null) && (op instanceof TableScanOperator)) {
            TableScanOperator tableScan = (TableScanOperator) op;
            PartitionDesc partitionDesc = mapWork.getAliasToPartnInfo().get(aliases.get(0));
            isMinorCompaction &= AcidUtils.isCompactionTable(partitionDesc.getTableDesc().getProperties());
            if (!tableScan.getConf().isTranscationalTable() && !isMinorCompaction) {
              String splitPath = getFirstSplitPath(splits);
              String errorMessage =
                  "Compactor split grouping is enabled only for transactional tables. Please check the path: "
                      + splitPath;
              LOG.error(errorMessage);
              throw new RuntimeException(errorMessage);
            }
          }
        }
      }
      /**
       * The expectation is that each InputSplit is a {@link org.apache.hadoop.hive.ql.io.HiveInputFormat.HiveInputSplit} 
       * wrapping an OrcSplit. So group these splits by bucketId and within each bucketId, sort by writeId, stmtId, 
       * rowIdOffset or splitStart. For 'original' splits (w/o acid meta cols in the file) SyntheticBucketProperties 
       * should always be there and so rowIdOffset is there. For 'native' acid files, OrcSplit doesn't have 
       * the 1st rowid in the split, so splitStart is used to sort. This should achieve the required sorting invariance 
       * (sort by: writeId, stmtId, rowIdOffset within each bucket) needed for Acid tables.
       * See: {@link org.apache.hadoop.hive.ql.io.AcidInputFormat}
       * Create a TezGroupedSplit for each bucketId and return.
       * TODO: Are there any other config values (split size etc) that can override this per writer split grouping?
       */
      return getCompactorSplitGroups(splits, conf, isMinorCompaction);
    }

    int i = 0;
    InputSplit prevSplit = null;
    for (InputSplit s : splits) {
      // this is the bit where we make sure we don't group across partition schema boundaries
      if (schemaEvolved(s, prevSplit, groupAcrossFiles, mapWork)) {
        ++i;
        prevSplit = s;
      }
      schemaGroupedSplitMultiMap.put(i, s);
    }
    LOG.info("# Src groups for split generation: " + (i + 1));
    // group them into the chunks we want
    Multimap<Integer, InputSplit> groupedSplits =
        this.group(jobConf, schemaGroupedSplitMultiMap, availableSlots, waves, locationProvider);
    return groupedSplits;
  }
Generate groups of splits, separated by schema evolution boundaries
OR
When used from compactor, group splits based on the bucket number of the input files
(in this case, splits for same logical bucket but different schema, end up in same group)
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/SplitGrouper.java