docs: public static void toSchema(StringBuilder sb, Procedure proc)
      {
          // CRUD: hasJava (false), m_defaultproc (true)
          // SQL: hasJava (false), m_defaultproc (false), m_statements.m_items."SQL"
          // JAVA: hasJava (true, m_defaultproc (false)
          if (proc.getDefaultproc()) {
              return;
          }
  
          // Build the optional ALLOW clause.
          CatalogMap<GroupRef> roleList = proc.getAuthgroups();
          String add;
          String allowClause = new String();
          if (roleList.size() > 0) {
              add = "\n" + spacer + "ALLOW ";
              for (GroupRef role : roleList) {
                  allowClause += add + role.getGroup().getTypeName();
                  add = ", ";
              }
          }
  
          // Build the optional PARTITION clause.
          StringBuilder partitionClause = new StringBuilder();
          ProcedureAnnotation annot = (ProcedureAnnotation) proc.getAnnotation();
          if (CatalogUtil.isProcedurePartitioned(proc)) {
              if (annot != null && annot.classAnnotated) {
                  partitionClause.append("--Annotated Partitioning Takes Precedence Over DDL Procedure Partitioning Statement\n--");
              }
              else {
                  partitionClause.append("\n");
              }
              partitionClause.append(spacer);
              partitionClause.append(String.format(
                      "PARTITION ON TABLE %s COLUMN %s",
                      proc.getPartitiontable().getTypeName(),
                      proc.getPartitioncolumn().getTypeName() ));
              if (proc.getPartitionparameter() != 0) {
                  partitionClause.append(String.format(
                          " PARAMETER %s",
                          String.valueOf(proc.getPartitionparameter()) ));
              }
  
              // For the second partition clause in 2p txn
              if (proc.getPartitioncolumn2() != null) {
                  partitionClause.append(spacer);
                  partitionClause.append(String.format(
                          "AND ON TABLE %s COLUMN %s",
                          proc.getPartitiontable2().getTypeName(),
                          proc.getPartitioncolumn2().getTypeName() ));
                  if (proc.getPartitionparameter2() != 1) {
                      partitionClause.append(String.format(
                              " PARAMETER %s",
                              String.valueOf(proc.getPartitionparameter2()) ));
                  }
              }
          }
  
          // Build the appropriate CREATE PROCEDURE statement variant.
          if (!proc.getHasjava()) {
              // SQL Statement procedure
  
              sb.append(String.format(
                      "CREATE PROCEDURE %s%s%s\n%sAS\nBEGIN\n%s%s",
                      proc.getClassname(),
                      allowClause,
                      partitionClause.toString(),
                      spacer,
                      spacer,
                      proc.getStatements().get("SQL0").getSqltext().trim()));
  
              for (int i = 1 ; i < proc.getStatements().size() ; i++ ) {
                  sb.append(String.format(
                          "\n%s%s",
                          spacer,
                          proc.getStatements().get("SQL" + String.valueOf(i)).getSqltext().trim()));
              }
              sb.append("\nEND");
          }
          else {
              // Java Class
              sb.append(String.format(
                      "CREATE PROCEDURE %s%s\n%sFROM CLASS %s",
                      allowClause,
                      partitionClause.toString(),
                      spacer,
                      proc.getClassname()));
          }
  
          // The SQL statement variant may have terminated the CREATE PROCEDURE statement.
          if (!sb.toString().endsWith(";")) {
              sb.append(";");
          }
  
          // Give me some space man.
          sb.append("\n\n");
      }