private Map<Integer, IntervalProcessor> getProcessorMap() {

    if (processorMap != null) {
      return processorMap;
    }

    Map<Integer, IntervalProcessor> ret = new HashMap<>();
    IntervalProcessor ips[]=new IntervalProcessor[]{
        new IntervalDayTimeLiteralProcessor(),

        new IntervalDayLiteralProcessor(),
        new IntervalHourLiteralProcessor(),
        new IntervalMinuteLiteralProcessor(),
        new IntervalSecondLiteralProcessor(),

        new IntervalYearMonthLiteralProcessor(),

        new IntervalYearLiteralProcessor(),
        new IntervalMonthLiteralProcessor(),
    };

    for (IntervalProcessor ip : ips) {
      ret.put(ip.getKey(), ip);
    }

    return processorMap=ret;
  }
GenericUDF Class for support of "INTERVAL (expression) (DAY|YEAR|...)".
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInternalInterval.java