@SuppressWarnings("unchecked")
  public <T> Optional<T> adapt(Class<T> clazz) {
    if (clazz.isInstance(this)) {
      return Optional.of((T) this);
    }
    return Optional.empty();
  }
Some information may be set during initialize() which needs to be saved when the UDF is copied.
This will be called by FunctionRegistry.cloneGenericUDF()
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java