protected HiveIntervalYearMonth getIntervalYearMonthValue(DeferredObject[] arguments, int i, PrimitiveCategory[] inputTypes,
      Converter[] converters) throws HiveException {
    Object obj;
    if ((obj = arguments[i].get()) == null) {
      return null;
    }

    HiveIntervalYearMonth intervalYearMonth;
    switch (inputTypes[i]) {
      case STRING:
      case VARCHAR:
      case CHAR:
        String intervalYearMonthStr = converters[i].convert(obj).toString();
        intervalYearMonth = HiveIntervalYearMonth.valueOf(intervalYearMonthStr);
        break;
      case INTERVAL_YEAR_MONTH:
        Object writableValue = converters[i].convert(obj);
        intervalYearMonth = ((HiveIntervalYearMonthWritable) writableValue).getHiveIntervalYearMonth();
        break;
      default:
        throw new UDFArgumentTypeException(0, getFuncName()
            + " only takes INTERVAL_YEAR_MONTH and STRING_GROUP types, got " + inputTypes[i]);
    }
    return intervalYearMonth;
  }
Some information may be set during initialize() which needs to be saved when the UDF is copied.
This will be called by FunctionRegistry.cloneGenericUDF()
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java