@Override
  public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo)
      throws SemanticException {
    ObjectInspector[] parameters = paramInfo.getParameterObjectInspectors();

    if (parameters.length < 1) {
      throw new UDFArgumentTypeException(-1, "At least one argument is expected (vertex name)");
    }

    String vertexName = GenericUDFExceptionInVertex.getVertexName(parameters, 0);
    String taskNumber = GenericUDFExceptionInVertex.getTaskNumber(parameters, 1);
    String taskAttemptNumber = GenericUDFExceptionInVertex.getTaskAttemptNumber(parameters, 2);

    GenericUDAFExceptionInVertexEvaluator evaluator =
        new GenericUDAFExceptionInVertexEvaluator(vertexName, taskNumber, taskAttemptNumber);
    return evaluator;
  }
This class implements the UDAF which can throw an exception in arbitrary aggregating vertex
(typically reducer) / task / task attempt.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFExceptionInVertex.java