docs: public static void cancel(StmtInput stmtInput) throws SFException,
                                                          SnowflakeSQLException
    {
      HttpPost httpRequest = null;
  
      AssertUtil.assertTrue(stmtInput.serverUrl != null,
                            "Missing server url for statement execution");
  
      AssertUtil.assertTrue(stmtInput.sql != null,
                            "Missing sql for statement execution");
  
      AssertUtil.assertTrue(stmtInput.mediaType != null,
                            "Missing media type for statement execution");
  
      AssertUtil.assertTrue(stmtInput.requestId != null,
                            "Missing request id for statement execution");
  
      AssertUtil.assertTrue(stmtInput.sessionToken != null,
                            "Missing session token for statement execution");
  
      try
      {
        URIBuilder uriBuilder = new URIBuilder(stmtInput.serverUrl);
  
        logger.debug("Aborting query: {}", stmtInput.sql);
  
        uriBuilder.setPath(SF_PATH_ABORT_REQUEST_V1);
  
        uriBuilder.addParameter(SF_QUERY_REQUEST_ID, UUID.randomUUID().toString());
  
        httpRequest = new HttpPost(uriBuilder.build());
  
        /*
         * The JSON input has two fields: sqlText and requestId
         */
        Map sqlJsonBody = new HashMap<String, Object>();
        sqlJsonBody.put("sqlText", stmtInput.sql);
        sqlJsonBody.put("requestId", stmtInput.requestId);
  
        String json = mapper.writeValueAsString(sqlJsonBody);
  
        logger.debug("JSON for cancel request: {}", json);
  
        StringEntity input = new StringEntity(json, Charset.forName("UTF-8"));
        input.setContentType("application/json");
        httpRequest.setEntity(input);
  
        httpRequest.addHeader("accept", stmtInput.mediaType);
  
        httpRequest.setHeader(SF_HEADER_AUTHORIZATION,
                              SF_HEADER_SNOWFLAKE_AUTHTYPE + " " + SF_HEADER_TOKEN_TAG
                              + "=\"" + stmtInput.sessionToken + "\"");
  
        setServiceNameHeader(stmtInput, httpRequest);
  
        String jsonString =
            HttpUtil.executeRequest(httpRequest,
                                    SF_CANCELING_RETRY_TIMEOUT_IN_MILLIS,
                                    0, null);
  
        // trace the response if requested
        logger.debug("Json response: {}", jsonString);
  
        JsonNode rootNode = null;
        rootNode = mapper.readTree(jsonString);
  
        // raise server side error as an exception if any
        SnowflakeUtil.checkErrorAndThrowException(rootNode);
      }
      catch (URISyntaxException | IOException ex)
      {
        logger.error(
            "Exception encountered when canceling " + httpRequest,
            ex);
  
        // raise internal exception if this is not a snowflake exception
        throw new SFException(ex,
                              ErrorCode.INTERNAL_ERROR,
                              ex.getLocalizedMessage());
      }
    }