private boolean isValidInputCategory(PrimitiveCategory cat) throws UDFArgumentTypeException {
    PrimitiveGrouping inputOIGroup = PrimitiveObjectInspectorUtils.getPrimitiveGrouping(cat);

    if (inputOIGroup == PrimitiveGrouping.STRING_GROUP) {
      return true;
    }
    if (inputOIGroup == PrimitiveGrouping.NUMERIC_GROUP) {
      switch (cat) {
      case DOUBLE:
      case FLOAT:
        return false;
      default:
        return true;
      }
    }
    return false;
  }
GenericUDF Class for support of "INTERVAL (expression) (DAY|YEAR|...)".
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInternalInterval.java