@Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    checkArgsSize(arguments, 2, 2);
    for (int i = 0; i < arguments.length; i++) {
      checkArgPrimitive(arguments, i);
      checkArgGroups(arguments, i, tsInputTypes, STRING_GROUP, DATE_GROUP);
      obtainTimestampConverter(arguments, i, tsInputTypes, tsConverters);
    }
    return PrimitiveObjectInspectorFactory.writableIntObjectInspector;
  }
UDFDateDiff.

Calculate the difference in the number of days. The time part of the string
will be ignored. If dateString1 is earlier than dateString2, then the
result can be negative.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java