private int printFunctions(Set<String> funcs) throws HiveException {
    try (DataOutputStream outStream = ShowUtils.getOutputStream(new Path(desc.getResFile()), context)) {
      SortedSet<String> sortedFuncs = new TreeSet<String>(funcs);
      sortedFuncs.removeAll(serdeConstants.PrimitiveTypes);

      for (String func : sortedFuncs) {
        outStream.writeBytes(func);
        outStream.write(Utilities.newLineCode);
      }

      return 0;
    } catch (IOException e) {
      LOG.warn("show function: ", e);
      return 1;
    } catch (Exception e) {
      throw new HiveException(e);
    }
  }
Operation process of showing the functions.
ql/src/java/org/apache/hadoop/hive/ql/ddl/function/show/ShowFunctionsOperation.java