private void checkHashModeEfficiency() throws HiveException {
      if (lastModeCheckRowCount > numRowsCompareHashAggr) {
        lastModeCheckRowCount = 0;
        if (LOG.isDebugEnabled()) {
          LOG.debug(String.format("checkHashModeEfficiency: HT:%d RC:%d MIN:%d",
              numEntriesHashTable, sumBatchSize, (long)(sumBatchSize * minReductionHashAggr)));
        }
        /**
         * For grouping sets, incoming data is processed multiple times depending on
         * grouping set length. sumBatchSize already accounts for this. Here we mainly check for
         * hashtable efficiency.
         */
        final long inputRecords = sumBatchSize;
        final long outputRecords = numEntriesHashTable + numFlushedOutEntriesBeforeFinalFlush;
        final float ratio = (outputRecords) / (inputRecords * 1.0f);
        if (ratio > minReductionHashAggr) {
          if (inputRecords > maxHtEntries) { // Don't bail out too soon.
            flush(true);
            changeToStreamingMode();
          }
        }
      }
    }
Checks if the HT reduces the number of entries by at least minReductionHashAggr factor
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorGroupByOperator.java