@Override
  public ErrorAndSolution getErrorAndSolution() {
    ErrorAndSolution es = null;
    if(getQueryMatches() && configMatches) {
      List<String> matchingLines = getRegexToLogLines().get(OUT_OF_MEMORY_REGEX);

      if (matchingLines.size() > 0) {
        String confName = HiveConf.ConfVars.HIVE_MAP_AGGR_HASH_MEMORY.toString();
        float confValue =  HiveConf.getFloatVar(getConf(),
            HiveConf.ConfVars.HIVE_MAP_AGGR_HASH_MEMORY);

        es = new ErrorAndSolution(
            "Out of memory due to hash maps used in map-side aggregation.",
            "Currently " + confName + " is set to " + confValue + ". " +
            "Try setting it to a lower value. i.e " +
            "'set " + confName + " = " + confValue/2 + ";'");
      }
    }
    reset();
    return es;
  }
Detects out-of-memory errors when hash tables in map-based aggregation group
by queries take up too much memory.

Conditions to check

1. The query contains a group by.
2. Map-side aggregation is turned on.
3. There is a out of memory exception in the log.
ql/src/java/org/apache/hadoop/hive/ql/exec/errors/MapAggrMemErrorHeuristic.java