public static ProcessingMode groupByDescModeToVectorProcessingMode(GroupByDesc.Mode mode,
      boolean hasKeys) {
    switch (mode) {
    case COMPLETE:
      return (hasKeys ? ProcessingMode.STREAMING : ProcessingMode.GLOBAL);
    case HASH:
      return ProcessingMode.HASH;
    case MERGEPARTIAL:
      return (hasKeys ? ProcessingMode.MERGE_PARTIAL : ProcessingMode.GLOBAL);
    case PARTIAL1:
    case PARTIAL2:
    case PARTIALS:
    case FINAL:
      return ProcessingMode.STREAMING;
    default:
      throw new RuntimeException("Unexpected GROUP BY mode " + mode.name());
    }
  }
Which ProcessingMode for VectorGroupByOperator?

    Decides using GroupByDesc.Mode and whether there are keys.

        Mode.COMPLETE      --&gt; (numKeys == 0 ? ProcessingMode.GLOBAL : ProcessingMode.STREAMING)

        Mode.HASH          --&gt; ProcessingMode.HASH

        Mode.MERGEPARTIAL  --&gt; (numKeys == 0 ? ProcessingMode.GLOBAL : ProcessingMode.MERGE_PARTIAL)

        Mode.PARTIAL1,
        Mode.PARTIAL2,
        Mode.PARTIALS,
        Mode.FINAL        --&gt; ProcessingMode.STREAMING
ql/src/java/org/apache/hadoop/hive/ql/plan/VectorGroupByDesc.java