public static String getVertexName(ObjectInspector[] parameters, int index) throws UDFArgumentTypeException {
    if (parameters[index] instanceof WritableConstantStringObjectInspector) {
      return ((WritableConstantStringObjectInspector) parameters[index]).getWritableConstantValue()
          .toString();
    } else {
      throw new UDFArgumentTypeException(index, String.format(
          "This argument takes only constant STRING, got %s", parameters[index].getTypeName()));
    }
  }
This class implements the UDF which can throw an exception in arbitrary vertex (typically mapper)
/ task / task attempt. For throwing exception in reducer side, where most probably
GroupByOperator codepath applies, GenericUDAFExceptionInVertex is used.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFExceptionInVertex.java