public Optional<RelDataType> getReturnRelDataType() {
      if (returnType == null) {
        return Optional.empty();
      } else {
        JavaTypeFactoryImpl typeFactory = new JavaTypeFactoryImpl(new HiveTypeSystemImpl());
        if (returnType instanceof ParameterizedType) {
          ParameterizedType parameterizedType = (ParameterizedType) returnType;
          if (parameterizedType.getRawType() == List.class) {
            final RelDataType componentRelType = typeFactory.createType(parameterizedType.getActualTypeArguments()[0]);
            return Optional
                .of(typeFactory.createArrayType(typeFactory.createTypeWithNullability(componentRelType, true), -1));
          }
          return Optional.empty();
        }
        return Optional.of(typeFactory.createType(returnType));
      }
    }
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