docs: public synchronized CompiledPlan planSqlCore(String sql, StatementPartitioning partitioning) {
          TrivialCostModel costModel = new TrivialCostModel();
          DatabaseEstimates estimates = new DatabaseEstimates();
  
          CompiledPlan plan = null;
          // This try-with-resources block acquires a global lock on all planning
          // This is required until we figure out how to do parallel planning.
          try (QueryPlanner planner = new QueryPlanner(
                  sql, "PlannerTool", "PlannerToolProc", m_database,
                  partitioning, m_hsql, estimates, !VoltCompiler.DEBUG_MODE,
                  costModel, null, null, DeterminismMode.FASTER, false)) {
  
              // do the expensive full planning.
              planner.parse();
              plan = planner.plan();
              assert(plan != null);
          }
          catch (Exception e) {
              /*
               * Don't log PlanningErrorExceptions or HSQLParseExceptions, as they
               * are at least somewhat expected.
               */
              String loggedMsg = "";
              if (!(e instanceof PlanningErrorException || e instanceof HSQLParseException)) {
                  logException(e, "Error compiling query");
                  loggedMsg = " (Stack trace has been written to the log.)";
              }
              if (e.getMessage() != null) {
                  throw new RuntimeException("SQL error while compiling query: " + e.getMessage() + loggedMsg, e);
              }
              throw new RuntimeException("SQL error while compiling query: " + e.toString() + loggedMsg, e);
          }
  
          if (plan == null) {
              throw new RuntimeException("Null plan received in PlannerTool.planSql");
          }
  
          return plan;
      }