private void registerAsHiveFunction(SketchFunctionDescriptor sfd) {
    if (sfd != null && sfd.getReturnRelDataType().isPresent()) {
      SqlFunction cdfFn =
          new HiveSqlFunction(sfd.name,
              SqlKind.OTHER_FUNCTION,
              ReturnTypes.explicit(sfd.getReturnRelDataType().get()),
              InferTypes.ANY_NULLABLE,
              OperandTypes.family(),
              SqlFunctionCategory.USER_DEFINED_FUNCTION,
              true,
              false);

      sfd.setCalciteFunction(cdfFn);
    }
  }
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