code: private void executeBatchRewrite(Results results,
        final ClientPrepareResult prepareResult, List<ParameterHolder[]> parameterList,
        boolean rewriteValues) throws SQLException {
  
      cmdPrologue();
  
      ParameterHolder[] parameters;
      int currentIndex = 0;
      int totalParameterList = parameterList.size();
  
      try {
  
        do {
  
          currentIndex = ComQuery.sendRewriteCmd(writer, prepareResult.getQueryParts(), currentIndex,
              prepareResult.getParamCount(), parameterList, rewriteValues);
          getResult(results);
  
          if (Thread.currentThread().isInterrupted()) {
            throw new SQLException("Interrupted during batch", INTERRUPTED_EXCEPTION.getSqlState(),
                -1);
          }
  
        } while (currentIndex < totalParameterList);
  
      } catch (SQLException sqlEx) {
        throw logQuery.exceptionWithQuery(sqlEx, prepareResult);
      } catch (IOException e) {
        throw handleIoException(e);
      } finally {
        results.setRewritten(rewriteValues);
      }
    }
docs: Specific execution for batch rewrite that has specific query for memory.
  
  @param results       result
  @param prepareResult prepareResult
  @param parameterList parameters
  @param rewriteValues is rewritable flag
  @throws SQLException exception