@Override
  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    String argString = PrimitiveObjectInspectorUtils.getString(arguments[1].get(), inputOI);
    if (argString == null) {
      return null;
    }
    try {
      return processor.evaluate(argString);
    } catch (Exception e) {
      throw new UDFArgumentTypeException(1, "Error parsing interval " + argString + " using:"
          + processor.getClass().getSimpleName());
    }
  }
GenericUDF Class for support of "INTERVAL (expression) (DAY|YEAR|...)".
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInternalInterval.java