@Override
    public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException {
      super.init(m, parameters);
      if (m != Mode.COMPLETE) {
        throw new HiveException("Only COMPLETE mode supported for " + fnName + " function");
      }

      inputOI = parameters;

      if (parameters.length == 3) {
        defaultValueConverter = ObjectInspectorConverters
                .getConverter(parameters[2], parameters[0]);
      }

      return ObjectInspectorFactory.getStandardListObjectInspector(ObjectInspectorUtils
              .getStandardObjectInspector(parameters[0]));
    }
abstract class for Lead &amp; lag UDAFs GenericUDAFLeadLag.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFLeadLag.java