docs: public VoltXMLElement getXMLCompiledStatement(String sql) throws HSQLParseException
      {
          Statement cs = null;
          sessionProxy.clearLocalTables();
          // clear the expression node id set for determinism
          sessionProxy.resetVoltNodeIds();
  
          try {
              cs = sessionProxy.compileStatement(sql);
          } catch (HsqlException caught) {
              // a switch in case we want to give more error details on additional error codes
              switch(caught.getErrorCode()) {
              case -ErrorCode.X_42581:
                  throw new HSQLParseException(
                          "SQL Syntax error in \"" + sql + "\" " + caught.getMessage(),
                          caught);
              default:
                  throw new HSQLParseException("Error in \"" + sql + "\" - " + caught.getMessage(), caught);
              }
          } catch (StackOverflowError caught) {
              // Handle this consistently in high level callers
              // regardless of where it is thrown.
              // It should be presumed to be a user error where the user is
              // exceeding a soft limit on the supportable complexity of a
              // SQL statement causing unreasonable levels of recursion.
              throw caught;
          } catch (Throwable caught) {
              // Expectable user errors should have been thrown as HSQLException.
              // So, this throwable should be an unexpected system error.
              // The details of these arbitrary Throwables are not typically
              // useful to an end user reading an error message.
              // They should be logged.
              m_logger.error("Unexpected error in the SQL parser for statement \"" + sql + "\" ",
                      caught);
              // The important thing for the end user is that
              // they be notified that there is a system error involved,
              // suggesting that it is not their fault -- though they MAY be
              // able to work around the issue with the help of VoltDB support
              // (especially if they can provide the log traces).
              throw new HSQLParseException(
                      "An unexpected system error was logged by the SQL parser for statement \"" + sql + "\" ",
                      caught);
          }
  
          //Result result = Result.newPrepareResponse(cs.id, cs.type, rmd, pmd);
          Result result = Result.newPrepareResponse(cs);
          if (result.hasError()) {
              throw new HSQLParseException(result.getMainString());
          }
  
          VoltXMLElement xml = null;
          xml = cs.voltGetStatementXML(sessionProxy);
          if (m_logger.isDebugEnabled()) {
              try {
                  /*
                   * Sometimes exceptions happen.
                   */
                  m_logger.debug(String.format("SQL: %s\n", sql));;
                  m_logger.debug(String.format("HSQLDB:\n%s", (cs == null) ? "<NULL>" : cs.describe(sessionProxy)));
                  m_logger.debug(String.format("VOLTDB:\n%s", (xml == null) ? "<NULL>" : xml.toXML()));
              }
              catch (Exception caught) {
                  m_logger.warn("Unexpected error in the SQL parser",
                          caught);
                  caught.printStackTrace(System.out);
              }
          }
  
          // this releases some small memory hsql uses that builds up over time if not
          // cleared
          // if it's not called for every call of getXMLCompiledStatement, that's ok;
          // it'll get called next time
          sessionProxy.sessionData.persistentStoreCollection.clearAllTables();
  
          // clean up sql-in expressions
          fixupInStatementExpressions(xml);
  
          assert(xml != null);
  
          return xml;
      }