@Override
  /**
   * Before init is called, logRegexes and queryRegexes should be populated.
   */
  public void init(String query, JobConf conf) {
    this.conf = conf;

    assert(queryRegex != null);

    Pattern queryPattern = Pattern.compile(queryRegex, Pattern.CASE_INSENSITIVE);
    queryMatches = queryPattern.matcher(query).find();

    for(String regex : logRegexes) {
      regexToPattern.put(regex, Pattern.compile(regex, Pattern.CASE_INSENSITIVE));
      regexToLogLines.put(regex, new ArrayList<String>());
    }
  }
Simple heuristic where the query and the lines of the task log file are run
through regular expressions to see if they resemble a known error condition.

Only a single regular expression can be supplied to match the query whereas
multiple regular expressions can be supplied to match lines from the log file.
A mapping is maintained from the regular expression to the lines from the log
file that it matched.
ql/src/java/org/apache/hadoop/hive/ql/exec/errors/RegexErrorHeuristic.java