docs: public void parse() throws PlanningErrorException {
          // reset any error message
          m_recentErrorMsg = null;
  
          // Reset plan node ids to start at 1 for this plan
          AbstractPlanNode.resetPlanNodeIds();
  
          // determine the type of the query
          //
          // (Hmmm...  seems like this pre-processing of the SQL text
          // and subsequent placement of UPSERT_TAG should be pushed down
          // into getXMLCompiledStatement)
          m_sql = m_sql.trim();
          if (m_sql.length() > 6 && m_sql.substring(0,6).toUpperCase().startsWith("UPSERT")) { // ENG-7395
              m_isUpsert = true;
              m_sql = "INSERT" + m_sql.substring(6);
          }
  
          // use HSQLDB to get XML that describes the semantics of the statement
          // this is much easier to parse than SQL and is checked against the catalog
          try {
              ParameterizationInfo.resetCurrentParamIndex();
  
              m_xmlSQL = m_HSQL.getXMLCompiledStatement(m_sql);
              //* enable to debug */ System.out.println("DEBUG: HSQL parsed:" + m_xmlSQL);
          }
          catch (HSQLParseException e) {
              // XXXLOG probably want a real log message here
              throw new PlanningErrorException(e.getMessage());
          }
  
          if (m_xmlSQL.name.equals("migrate")) {
              validateMigrateStmt(m_sql, m_xmlSQL, m_db);
          } else if (m_isUpsert) {
              assert(m_xmlSQL.name.equalsIgnoreCase("INSERT"));
              // for AdHoc cache distinguish purpose which is based on the XML
              m_xmlSQL.attributes.put(UPSERT_TAG, "true");
          }
  
          m_planSelector.outputCompiledStatement(m_xmlSQL);
      }