@Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    checkArgsSize(arguments, 1, 1);

    checkArgPrimitive(arguments, 0);

    checkArgGroups(arguments, 0, inputTypes, STRING_GROUP, DATE_GROUP, VOID_GROUP);

    obtainDateConverter(arguments, 0, inputTypes, converters);

    ObjectInspector outputOI = PrimitiveObjectInspectorFactory.writableStringObjectInspector;
    return outputOI;
  }
GenericUDFLastDay.

Returns the last day of the month which the date belongs to.
The time part of the date will be  ignored.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLastDay.java