public int getErrorCode() {
    for (String task : failures.keySet()) {
      if (failures.get(task).intValue() == maxFailures) {
        TaskInfo ti = taskIdToInfo.get(task);
        return ti.getErrorCode();
      }
    }
    // Should never reach here unless there were no failed tasks.
    return 0;
  }
JobDebugger takes a RunningJob that has failed and grabs the top 4 failing
tasks and outputs this information to the Hive CLI.
ql/src/java/org/apache/hadoop/hive/ql/exec/mr/JobDebugger.java