private boolean nextWithoutLimit ( ) throws SQLException { if ( maxRows > 0 && rowsFetched >= maxRows ) { System . out . println ( "Reach max rows " + maxRows ) ; return false ; } if ( ( recordItr == null || ! recordItr . hasNext ( ) ) && ! emptyResultSet ) { TSFetchResultsReq req = new TSFetchResultsReq ( sql , fetchSize ) ; try { TSFetchResultsResp resp = client . fetchResults ( req ) ; Utils . verifySuccess ( resp . getStatus ( ) ) ; if ( ! resp . hasResultSet ) { emptyResultSet = true ; } else { TSQueryDataSet tsQueryDataSet = resp . getQueryDataSet ( ) ; List < RowRecord > records = Utils . convertRowRecords ( tsQueryDataSet ) ; recordItr = records . iterator ( ) ; } } catch ( TException e ) { throw new SQLException ( "Cannot fetch result from server, because of network connection" ) ; } } if ( emptyResultSet ) { return false ; } record = recordItr . next ( ) ; // if(record.getDeltaObjectType() != null && // record.getDeltaObjectType().equals(AGGREGATION_STR)){ // if(columnInfo.containsKey(TIMESTAMP_STR)){ // columnInfo.remove(TIMESTAMP_STR); // } // } rowsFetched ++ ; // maxRows is a constraint that exists in parallel with the LIMIT&SLIMIT constraints, // so rowsFetched will increase whenever the row is fetched, // regardless of whether the row satisfies the LIMIT&SLIMIT constraints or not. return true ; }
the next record rule without considering the LIMIT&SLIMIT constraints