docs: private void compileDatabase(
              Database db,
              HSQLInterface hsql,
              VoltDDLElementTracker voltDdlTracker,
              VoltCompilerReader cannonicalDDLIfAny,
              Database previousDBIfAny,
              List<VoltCompilerReader> schemaReaders,
              Collection<Class<?>> classDependencies,
              DdlProceduresToLoad whichProcs,
              InMemoryJarfile jarOutput)
                      throws VoltCompilerException
      {
          // Actually parse and handle all the DDL
          // DDLCompiler also provides partition descriptors for DDL PARTITION
          // and REPLICATE statements.
          final DDLCompiler ddlcompiler;
          ddlcompiler = new DDLCompiler(this, hsql, voltDdlTracker, m_classLoader);
  
          // Ugly, ugly hack.
          // If the procedure compilations do not succeed, and we have
          // dropped some UDFs, then we need to restore them.
          try {
              //
              // Save the old user defined functions, if there are any,
              // in case we encounter a compilation error.
              //
              ddlcompiler.saveDefinedFunctions();
              if (cannonicalDDLIfAny != null) {
                  // add the file object's path to the list of files for the jar
                  m_ddlFilePaths.put(cannonicalDDLIfAny.getName(), cannonicalDDLIfAny.getPath());
                  ddlcompiler.loadSchema(cannonicalDDLIfAny, db, whichProcs);
              }
  
              m_dirtyTables.clear();
  
              for (final VoltCompilerReader schemaReader : schemaReaders) {
                  String origFilename = m_currentFilename;
                  try {
                      if (m_currentFilename.equals(NO_FILENAME)) {
                          m_currentFilename = schemaReader.getName();
                      }
  
                      // add the file object's path to the list of files for the jar
                      m_ddlFilePaths.put(schemaReader.getName(), schemaReader.getPath());
  
                      if (m_filterWithSQLCommand) {
                          SQLParser.FileInfo fi = new SQLParser.FileInfo(schemaReader.getPath());
                          ddlcompiler.loadSchemaWithFiltering(schemaReader, db, whichProcs, fi);
                      }
                      else {
                          ddlcompiler.loadSchema(schemaReader, db, whichProcs);
                      }
                  }
                  finally {
                      m_currentFilename = origFilename;
                  }
              }
  
              // When A/A is enabled, create an export table for every DR table to log possible conflicts
              ddlcompiler.loadAutogenExportTableSchema(db, previousDBIfAny, whichProcs, m_isXDCR);
  
              ddlcompiler.compileToCatalog(db, m_isXDCR);
  
              // add database estimates info
              addDatabaseEstimatesInfo(m_estimates, db);
  
              // Process DDL exported tables
              NavigableMap<String, NavigableSet<String>> exportTables = voltDdlTracker.getExportedTables();
              for (Entry<String, NavigableSet<String>> e : exportTables.entrySet()) {
                  String targetName = e.getKey();
                  for (String tableName : e.getValue()) {
                      addExportTableToConnector(targetName, tableName, db);
                  }
              }
              Map<String, String> persistentExportTables = voltDdlTracker.getPersistentTableTargetMap();
              for (Entry<String, String> e : persistentExportTables.entrySet()) {
                  addExportTableToConnector(e.getValue(), e.getKey(), db);
              }
              ddlcompiler.processMaterializedViewWarnings(db);
  
              // process DRed tables
              for (Entry<String, String> drNode: voltDdlTracker.getDRedTables().entrySet()) {
                  compileDRTable(drNode, db);
              }
  
              if (whichProcs != DdlProceduresToLoad.NO_DDL_PROCEDURES) {
                  Collection<ProcedureDescriptor> allProcs = voltDdlTracker.getProcedureDescriptors();
                  CatalogMap<Procedure> previousProcsIfAny = null;
                  if (previousDBIfAny != null) {
                      previousProcsIfAny = previousDBIfAny.getProcedures();
                  }
                  compileProcedures(db, hsql, allProcs, classDependencies, whichProcs, previousProcsIfAny, jarOutput);
              }
  
              // add extra classes from the DDL
              m_addedClasses = voltDdlTracker.m_extraClassses.toArray(new String[0]);
              addExtraClasses(jarOutput);
  
              compileRowLimitDeleteStmts(db, hsql, ddlcompiler.getLimitDeleteStmtToXmlEntries());
          }
          catch (Throwable ex) {
              ddlcompiler.restoreSavedFunctions();
              throw ex;
          }
          ddlcompiler.clearSavedFunctions();
      }