private void registerHiveFunctionsInternal(Registry system) {
    for (SketchDescriptor sketchDescriptor : sketchClasses.values()) {
      Collection<SketchFunctionDescriptor> functions = sketchDescriptor.fnMap.values();
      for (SketchFunctionDescriptor fn : functions) {
        if (UDF.class.isAssignableFrom(fn.udfClass)) {
          system.registerUDF(fn.name, (Class<? extends UDF>) fn.udfClass, false);
          continue;
        }
        if (GenericUDAFResolver2.class.isAssignableFrom(fn.udfClass)) {
          String name = fn.name;
          try {
            system.registerGenericUDAF(name, ((Class<? extends GenericUDAFResolver2>) fn.udfClass).newInstance());
          } catch (InstantiationException | IllegalAccessException e) {
            throw new RuntimeException("Unable to register: " + name, e);
          }
          continue;
        }
        if (GenericUDTF.class.isAssignableFrom(fn.udfClass)) {
          system.registerGenericUDTF(fn.name, (Class<? extends GenericUDTF>) fn.udfClass);
          continue;
        }
        throw new RuntimeException("Don't know how to register: " + fn.name);
      }
    }

  }
Registers functions from the DataSketches library as builtin functions.

In an effort to show a more consistent
ql/src/java/org/apache/hadoop/hive/ql/exec/DataSketchesFunctions.java