code: static protected String getQueryResult(JsonNode inProgressResponse,
                                           String previousGetResultPath,
                                           StmtInput stmtInput)
    throws SFException, SnowflakeSQLException
    {
      String getResultPath = null;
  
      // get result url better not be empty
      if (inProgressResponse == null ||
          inProgressResponse.path("data").path("getResultUrl").isMissingNode())
      {
        if (previousGetResultPath == null)
        {
          throw new SFException(ErrorCode.INTERNAL_ERROR,
                                "No query response or missing get result URL");
        }
        else
        {
          logger.debug("No query response or missing get result URL, " +
                       "use previous get result URL: {}", previousGetResultPath);
          getResultPath = previousGetResultPath;
        }
      }
      else
      {
        getResultPath = inProgressResponse.path("data").path("getResultUrl").
            asText();
      }
      return getQueryResult(
          getResultPath,
          stmtInput
      );
    }
docs: Issue get-result call to get query result given an in-progress response.
  <p>
  
  @param inProgressResponse    In progress response in JSON form
  @param previousGetResultPath previous get results path
  @param stmtInput             input statement
  @return results in string form
  @throws SFException           exception raised from Snowflake components
  @throws SnowflakeSQLException exception raised from Snowflake components