@Override
  public boolean next() throws SFException, SnowflakeSQLException
  {
    if (isClosed())
    {
      return false;
    }

    // otherwise try to fetch again
    if (fetchNextRow())
    {
      row++;
      if (isLast())
      {
        long timeConsumeLastResult = System.currentTimeMillis() - this.firstChunkTime;
        logMetric(TelemetryField.TIME_CONSUME_LAST_RESULT, timeConsumeLastResult);
      }
      return true;
    }
    else
    {
      logger.debug("end of result");

      /*
       * Here we check if the result has been truncated and throw exception if
       * so.
       */
      if (totalRowCountTruncated ||
          System.getProperty("snowflake.enable_incident_test2") != null &&
          System.getProperty("snowflake.enable_incident_test2").equals("true"))
      {
        throw (SFException) IncidentUtil.generateIncidentV2WithException(
            session,
            new SFException(ErrorCode.MAX_RESULT_LIMIT_EXCEEDED),
            queryId,
            null);
      }

      // mark end of result
      return false;
    }
  }
@ Override public boolean next ( ) throws SFException , SnowflakeSQLException { if ( isClosed ( ) ) { return false ; } if ( fetchNextRow ( ) ) { row ++ ; if ( isLast ( ) ) { long timeConsumeLastResult = System . currentTimeMillis ( ) - this . firstChunkTime ; logMetric ( TelemetryField . TIME_CONSUME_LAST_RESULT , timeConsumeLastResult ) ; } return true ; } else { logger . debug ( "end of result" ) ; if ( totalRowCountTruncated || System . getProperty ( "snowflake.enable_incident_test2" ) != null && System . getProperty ( "snowflake.enable_incident_test2" ) . equals ( "true" ) ) { throw ( SFException ) IncidentUtil . generateIncidentV2WithException ( session , new SFException ( ErrorCode . MAX_RESULT_LIMIT_EXCEEDED ) , queryId , null ) ; } return false ; } }
Advance to next row

@return true if next row exists, false otherwise